Skip to content

Security: Untrusted kernel output can execute arbitrary JavaScript in renderer#2180

Closed
tuanaiseo wants to merge 2 commits intonteract:masterfrom
tuanaiseo:contribai/fix/security/untrusted-kernel-output-can-execute-arbi
Closed

Security: Untrusted kernel output can execute arbitrary JavaScript in renderer#2180
tuanaiseo wants to merge 2 commits intonteract:masterfrom
tuanaiseo:contribai/fix/security/untrusted-kernel-output-can-execute-arbi

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The output renderer explicitly enables Media.JavaScript and Media.HTML for all kernel outputs. Because kernel responses are treated as trusted, a malicious or compromised kernel (or remote session) can send crafted output that runs script in Atom's renderer context, potentially leading to code execution or credential theft in an Electron app.

Severity: critical
File: lib/components/result-view/display.tsx

Solution

Disable Media.JavaScript by default and gate active content behind an explicit trust model (per-kernel/per-document trust prompt). Sanitize HTML with a strict allowlist sanitizer (for example DOMPurify with hardened config), and render untrusted rich outputs in a sandboxed iframe without Node/Electron privileges.

Changes

  • lib/components/result-view/display.tsx (modified)
  • lib/components/inspector.tsx (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The output renderer explicitly enables `Media.JavaScript` and `Media.HTML` for all kernel outputs. Because kernel responses are treated as trusted, a malicious or compromised kernel (or remote session) can send crafted output that runs script in Atom's renderer context, potentially leading to code execution or credential theft in an Electron app.

Affected files: display.tsx, inspector.tsx

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
The output renderer explicitly enables `Media.JavaScript` and `Media.HTML` for all kernel outputs. Because kernel responses are treated as trusted, a malicious or compromised kernel (or remote session) can send crafted output that runs script in Atom's renderer context, potentially leading to code execution or credential theft in an Electron app.

Affected files: display.tsx, inspector.tsx

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
Copy link
Copy Markdown
Member

@aminya aminya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix isn't to removes features that the users relied on.

@aminya aminya closed this Apr 5, 2026
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.

2 participants