/

CVE-2026-47666

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in Penpot Custom Font Handling Bug

CVE-2026-47666

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Session compromise and unauthorized actions

Severity:

HIGH RISK

(7.6)

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 is vulnerable to stored cross-site scripting when custom font family names are inserted into generated CSS and rendered as HTML without sanitization. A team member who opens a file containing a malicious font reference may trigger JavaScript execution in the Penpot origin, potentially allowing actions as the victim and access to their projects.

Affected context

The vulnerability affects Penpot deployments that accept arbitrary custom font family names, interpolate those names into a generated @font-face rule, and insert the resulting content into the page through an HTML-capable sink. It becomes risky when an attacker can create or modify a shared design file and another team member later opens or renders that file.

Exploit preconditions

  • Attack surface: Penpot file content and frontend rendering of custom font definitions
  • Required access: Ability to create or modify a file, font reference, or other content accepted by the affected workflow
  • Trigger point: A victim opens or renders a file containing the stored malicious font value
  • Why exploitation is possible: The font family value reaches an HTML-capable rendering path without adequate output encoding or sanitization, allowing stored content to escape its intended CSS context

Why this happens

The underlying bug is context-unsafe handling of user-controlled data. Penpot accepts an arbitrary font-family string, interpolates it into CSS, and writes the resulting style through innerHTML without ensuring that the value remains confined to a CSS string or declaration.

This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled data is stored and later interpreted as executable browser content rather than being safely encoded for its output context.

Potential impact

  • JavaScript execution in the Penpot origin
  • Theft of session data or other accessible browser credentials
  • Actions performed with the victim's permissions
  • Unauthorized access to files, projects, or team content
  • Modification or destruction of shared design assets
  • Further compromise of accounts or connected workflows

General mitigation guidance

Mitigation generally focuses on preserving strict separation between data, CSS, and HTML contexts.

Common defensive patterns include:

  • Treating font family names and related metadata as untrusted input
  • Applying context-aware encoding before inserting values into CSS
  • Prefering DOM and stylesheet APIs that assign structured values instead of using innerHTML
  • Enforcing an allowlist or strict grammar for accepted font family names
  • Sanitizing stored content before rendering, while retaining output encoding as the primary control
  • Applying restrictive content security policies as defense in depth
  • Limiting file-editing permissions and reviewing content-sharing boundaries

How teams detect issues like this

Organizations can identify similar issues through:

  • Static analysis rules for innerHTML and other HTML-capable sinks receiving stored or request-derived data
  • Searches for string interpolation into <style> elements, CSS rules, or generated markup
  • Code review checks for missing context-aware encoding and unrestricted font metadata
  • Dynamic testing with benign marker values that verify whether CSS and HTML contexts remain isolated
  • Policy enforcement that prohibits unsafe DOM sinks unless explicitly justified and reviewed
  • Automated security review tools that trace user-controlled data into browser rendering APIs

Sources

SourceLink
github.comgithub.com/penpot/penpot/commit/67d95679711da538b3b22a873bcb6c197104dc0c
github.comgithub.com/penpot/penpot/security/advisories/GHSA-w5hh-gj5c-5wpc

Frequently asked

questions

It can be exploitable through normal application workflows when an attacker who can edit or create shared content causes another user to open the affected file. Exploitation does not necessarily require direct network access to the victim's browser beyond ordinary Penpot use.

The attacker generally needs permission to create or modify a file or font-related value that will be rendered by another team member. The exact scope depends on workspace permissions and sharing controls.

Keep font metadata in a strictly validated data model, use structured stylesheet APIs where possible, and apply context-appropriate encoding rather than inserting generated content through innerHTML.

Treat all stored design metadata as untrusted, enforce output-context safety in code review and static analysis, restrict content-editing permissions, and use browser security policies as defense in depth.

Find out what's already
exploitable in your codebase.