mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-26 07:24:20 +00:00
Merge commit from fork
Add rehype-sanitize after rehypeRaw in all ReactMarkdown usages: - PluginReadme.tsx (plugin README rendering) - DebugDialog.tsx (debug chat message rendering) - NewVersionDialog.tsx (release notes rendering) This prevents injection of raw HTML (e.g. <iframe srcdoc>) that could steal session tokens and API credentials from localStorage. Fixes GHSA-w8gq-g4pc-xh3h
This commit is contained in:
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import ReactMarkdown from 'react-markdown';
|
||||
import remarkGfm from 'remark-gfm';
|
||||
import rehypeRaw from 'rehype-raw';
|
||||
import rehypeSanitize from 'rehype-sanitize';
|
||||
import rehypeHighlight from 'rehype-highlight';
|
||||
import rehypeSlug from 'rehype-slug';
|
||||
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
||||
@@ -51,6 +52,7 @@ export default function PluginReadme({
|
||||
remarkPlugins={[remarkGfm]}
|
||||
rehypePlugins={[
|
||||
rehypeRaw,
|
||||
rehypeSanitize,
|
||||
rehypeHighlight,
|
||||
rehypeSlug,
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user