/

CVE-2026-47665

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in Penpot Shared File Comments UI

CVE-2026-47665

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Session compromise and unauthorized actions in users' browsers

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Penpot contains a stored cross-site scripting vulnerability in file comments because comment content is rendered with innerHTML without sanitization. A team member who can comment on a shared file may cause scripts to execute in the browsers of collaborators who open the comments panel, potentially enabling actions as those users and access to their Penpot data.

Affected context

The vulnerability occurs in Penpot file comments when comment text is stored without removing active markup and later inserted into the page as HTML. It is relevant to shared files where one team member can create comments and other collaborators may view the affected comments panel.

Exploit preconditions

  • Attack surface: Penpot's file comment interface
  • Required access: Permission to comment on a shared file
  • Trigger point: A collaborator opens the comments panel for the affected file
  • Why exploitation is possible: Comment content is written to the browser through innerHTML without effective sanitization, allowing active HTML or script-capable browser behavior to run in the Penpot origin

Why this happens

The underlying bug is a failure to treat user-controlled comment content as untrusted data when rendering it in the browser. A length check limits size but does not neutralize markup, while direct use of innerHTML permits attacker-controlled content to become executable page structure. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Session information may be exposed to malicious code, subject to browser cookie protections
  • Actions could be performed as an affected collaborator
  • Private files and projects may be accessed or modified
  • Project content could be altered or exfiltrated
  • Additional users may be affected when they view the same shared file

General mitigation guidance

Mitigation generally focuses on ensuring that comment content is treated as text or is safely sanitized before rendering.

Common defensive patterns include:

  • Prefer text-rendering APIs such as textContent for untrusted comments
  • Apply a well-maintained, context-aware HTML sanitizer when limited formatting is required
  • Enforce output encoding appropriate to the rendering context
  • Avoid assigning untrusted values to innerHTML and similar injection-prone sinks
  • Apply restrictive Content Security Policy controls as defense in depth
  • Limit project and file permissions according to least privilege
  • Reduce trust in user-generated content across all collaborative surfaces

How teams detect issues like this

Organizations can detect related issues through:

  • Static analysis rules identifying innerHTML assignments fed by user-controlled data
  • Code review checks for unsanitized comment, annotation, or messaging content
  • Testing that submits markup and script-capable inputs to collaborative text fields
  • Browser security testing that verifies rendered content remains inert
  • Policy enforcement requiring approved sanitization libraries for HTML rendering
  • Automated code review tools that flag unsafe DOM sinks and missing output encoding

Sources

SourceLink
github.comgithub.com/penpot/penpot/commit/29f940fb7ab521033b1e276b8285afbc3609df6c
github.comgithub.com/penpot/penpot/security/advisories/GHSA-vc72-6r45-q988

Frequently asked

questions

Any team member who can add comments to a shared file may be able to place malicious content there. Other collaborators become targets when they view the affected comments panel.

No. The attack is passive after the comment is stored; opening the relevant comments panel can trigger the browser-side execution.

Render comments as plain text by default. If formatting is necessary, sanitize content with a context-aware allowlist before inserting it into the DOM.

Treat all user-generated content as untrusted, avoid unsafe DOM sinks, enforce output encoding and sanitization policies, and include stored-XSS tests in code review and security testing.

Find out what's already
exploitable in your codebase.