Skip to content

fix: remove unsafe exec() in use-chat.ts#9884

Open
orbisai0security wants to merge 1 commit intonilbuild:masterfrom
orbisai0security:fix-v-003-sanitize-ai-chat-html-xss
Open

fix: remove unsafe exec() in use-chat.ts#9884
orbisai0security wants to merge 1 commit intonilbuild:masterfrom
orbisai0security:fix-v-003-sanitize-ai-chat-html-xss

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix high severity security issue in src/hooks/use-chat.ts.

Vulnerability

Field Value
ID V-003
Severity HIGH
Scanner multi_agent_ai
Rule V-003
File src/hooks/use-chat.ts:46
CWE CWE-79

Description: The application fetches AI-generated content from external APIs in use-chat.ts:46 and use-roadmap-ai-chat.tsx:161, then renders it in React components. AI chat interfaces commonly render markdown/HTML content using dangerouslySetInnerHTML for rich text display. If AI-generated content (which can be manipulated via prompt injection per V-002) is rendered without sanitization, it creates a stored XSS vector. The combination of prompt injection and unsanitized rendering creates a complete attack chain: inject malicious HTML via node title → AI outputs it → stored in roadmap → executes in all viewers' browsers.

Changes

  • src/lib/markdown.ts

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant