fix(security): remediate audit vulnerabilities SEC-001 through SEC-023
This commit is contained in:
1 parent
dc88677169
commit
bd49fbc4a0
31 files changed
+867
-114
No files matched your search
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import type { Metadata } from "next";
|
||||
import B2BLandingClient from "@/components/B2BLandingClient";
|
||||
import { getPageMetadata } from "@/lib/seo";
|
||||
import { generateB2BServiceSchema, generateBreadcrumbSchema } from "@/lib/schema";
|
||||
import { generateB2BServiceSchema, generateBreadcrumbSchema, safeJsonLd } from "@/lib/schema";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return getPageMetadata('b2b', {
|
||||
@@ -26,11 +26,11 @@ export default function B2BPage() {
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(b2bServiceSchema) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(b2bServiceSchema) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbs) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbs) }}
|
||||
/>
|
||||
<B2BLandingClient />
|
||||
</>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { notFound } from 'next/navigation';
|
||||
import type { Metadata } from 'next';
|
||||
import BlogPostClient from "../../../components/BlogPostClient";
|
||||
import { getSeoConfig, formatPageTitle } from "../../../lib/seo";
|
||||
import { safeJsonLd } from "../../../lib/schema";
|
||||
|
||||
function safeIso(val: any, fallback?: string): string | undefined {
|
||||
if (!val) return fallback;
|
||||
@@ -246,11 +247,11 @@ export default async function BlogPostPage({ params }: { params: Promise<{ slug:
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(articleJsonLd) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbJsonLd) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbJsonLd) }}
|
||||
/>
|
||||
<BlogPostClient
|
||||
blog={blog}
|
||||
|
||||
@@ -10,7 +10,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
||||
});
|
||||
}
|
||||
|
||||
import { generateLocalBusinessSchema, generateBreadcrumbSchema } from "@/lib/schema";
|
||||
import { generateLocalBusinessSchema, generateBreadcrumbSchema, safeJsonLd } from "@/lib/schema";
|
||||
|
||||
export default function ContactPage() {
|
||||
const localBusinessSchema = generateLocalBusinessSchema({
|
||||
@@ -35,11 +35,11 @@ export default function ContactPage() {
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(localBusinessSchema) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(localBusinessSchema) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbs) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbs) }}
|
||||
/>
|
||||
<div className="bg-medical-gray-50 py-16 px-4 sm:px-6 lg:px-8 font-vazir" dir="rtl">
|
||||
<div className="max-w-6xl mx-auto space-y-16">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Metadata } from 'next';
|
||||
import VideosPage from "../../components/VideosPage";
|
||||
import { getPageMetadata } from "../../lib/seo";
|
||||
import { generateVideoObjectSchema, generateBreadcrumbSchema } from "../../lib/schema";
|
||||
import { generateVideoObjectSchema, generateBreadcrumbSchema, safeJsonLd } from "../../lib/schema";
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
return getPageMetadata('videos', {
|
||||
@@ -61,12 +61,12 @@ export default async function Videos() {
|
||||
{videoSchemas.length > 0 && (
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(itemListSchema) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(itemListSchema) }}
|
||||
/>
|
||||
)}
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbs) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbs) }}
|
||||
/>
|
||||
<VideosPage />
|
||||
</>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import Link from 'next/link';
|
||||
import { ChevronRight, Sparkles, Package, ArrowLeft, ShieldCheck } from 'lucide-react';
|
||||
import type { Metadata } from 'next';
|
||||
import sanitizeHtml from 'sanitize-html';
|
||||
import { getSeoConfig, formatPageTitle } from "../../../lib/seo";
|
||||
import { generateMedicalWebPageSchema, generateBreadcrumbSchema } from "../../../lib/schema";
|
||||
import { generateMedicalWebPageSchema, generateBreadcrumbSchema, safeJsonLd } from "../../../lib/schema";
|
||||
import SafeImage from "../../../components/SafeImage";
|
||||
|
||||
const API_URL = process.env.INTERNAL_API_URL || process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4001/api';
|
||||
@@ -110,11 +111,11 @@ export default async function WikiTermPage({ params }: { params: Promise<{ slug:
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(medicalSchema) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(medicalSchema) }}
|
||||
/>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbs) }}
|
||||
dangerouslySetInnerHTML={{ __html: safeJsonLd(breadcrumbs) }}
|
||||
/>
|
||||
|
||||
<div className="bg-medical-gray-50 min-h-screen py-12 px-4 sm:px-6 lg:px-8 font-vazir" dir="rtl">
|
||||
@@ -143,7 +144,18 @@ export default async function WikiTermPage({ params }: { params: Promise<{ slug:
|
||||
|
||||
<div
|
||||
className="prose prose-lg max-w-none text-medical-gray-700 leading-relaxed prose-headings:font-black prose-headings:text-medical-gray-900 prose-p:leading-loose"
|
||||
dangerouslySetInnerHTML={{ __html: term.definition }}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: sanitizeHtml(term.definition || '', {
|
||||
allowedTags: sanitizeHtml.defaults.allowedTags.concat(['img', 'h1', 'h2', 'span']),
|
||||
allowedAttributes: {
|
||||
...sanitizeHtml.defaults.allowedAttributes,
|
||||
img: ['src', 'alt', 'title', 'width', 'height', 'loading'],
|
||||
span: ['class', 'style'],
|
||||
div: ['class'],
|
||||
p: ['class'],
|
||||
},
|
||||
}),
|
||||
}}
|
||||
/>
|
||||
</article>
|
||||
|
||||
|
||||
Reference in new issue
Block a user