fix(security): remediate audit vulnerabilities SEC-001 through SEC-023
Deploy Canina / deploy (push) Successful in 2m25s
E2E Playwright Tests / Run Full E2E & Security Suites (push) Failing after 7s

This commit is contained in:
parsa committed 2026-09-23 23:00:25 +03:30
1 parent dc88677169
commit bd49fbc4a0
31 files changed
+867 -114

No files matched your search

+16 -4
View File
@@ -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>