Skip to content

fix(mcp): OAuth callback error page XSS via unescaped error parameter (CWE-79) #17364

@kvenux

Description

@kvenux

Bug Report

Description: packages/opencode/src/mcp/oauth-callback.ts:27-46HTML_ERROR function interpolates the error string directly into HTML without escaping. The error value comes from URL query parameters (error, error_description), so an attacker can craft a malicious OAuth callback URL to inject arbitrary HTML/JS.
CWE: CWE-79
Severity: High
Reproduction: See POC test in PR

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions