diff --git a/src/app/components/FeedbackCards.tsx b/src/app/components/FeedbackCards.tsx index a3e8106..9fe075f 100644 --- a/src/app/components/FeedbackCards.tsx +++ b/src/app/components/FeedbackCards.tsx @@ -258,6 +258,13 @@ function ReplySection({ threadId, initialReplies, isAdmin }: { threadId: string, setPreviews(prev => prev.filter((_, i) => i !== idx)); }; + const getSafeImagePreviewSrc = (src: string): string => { + if (typeof src !== 'string') return ''; + if (src.startsWith('blob:')) return src; + if (/^data:image\/[a-zA-Z0-9.+-]+;base64,[a-zA-Z0-9+/=\s]+$/.test(src)) return src; + return ''; + }; + const handleReply = async () => { if ((!replyText.trim() && images.length === 0) || isSubmitting) return; setIsSubmitting(true); @@ -387,7 +394,7 @@ function ReplySection({ threadId, initialReplies, isAdmin }: { threadId: string, {previews.map((src, i) => (
{/* CodeQL fix: sanitize image src */} - +