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
@@ -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