Summary
Penpot includes an arbitrary file read vulnerability where an authenticated user can coerce the backend into reading local files by supplying a filesystem path as font data to the create-font-variant RPC endpoint.
When exploited, the contents of sensitive files on the server are ingested and stored as "font" assets, allowing attackers with team edit permissions to access system files, secrets, and credentials reachable by the Penpot process.
Affected context
This vulnerability affects Penpot server deployments where:
- The
create-font-variantRPC endpoint is exposed and usable by authenticated users. - Application users can upload or define custom font data as part of design collaboration features.
- The backend runs with permissions to read local files on the host or container filesystem.
The issue arises when the backend treats font data chunks as paths to local files without properly constraining or validating them, allowing users with team edit permissions to target arbitrary readable paths such as configuration files, credential stores, and other sensitive resources.
Exploit preconditions
- Attack surface: Application-layer RPC endpoint (
create-font-variant) exposed by the Penpot backend. - Required access: Valid authenticated account with team edit permissions or similar rights to create or modify font assets.
- Trigger point: Submission of a crafted font variant request where a local filesystem path (e.g.,
/etc/passwdor a configuration file path) is supplied as the font data chunk. - Why exploitation is possible: The backend logic accepts user-controlled input and uses it to read from the server's local filesystem without sufficiently constraining allowed locations or enforcing strict separation between uploaded data and local file access.
Why this happens
The core issue is improper restriction of user-supplied paths used in file operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') and CWE-73: External Control of File Name or Path.
Instead of treating font data purely as opaque, untrusted content, the implementation allows that input to influence which local file is opened and read. Without filtering or confining paths to a safe directory, attackers can reference arbitrary readable files. This design breaks the assumption that authenticated users can only access assets they uploaded or are explicitly authorized to use and instead grants them indirect read access to backend-local files.
Potential impact
- Exposure of sensitive system files (e.g., user account information, service configuration).
- Disclosure of application secrets, API keys, and cryptographic material stored on disk.
- Access to database connection strings and credentials, potentially enabling database compromise.
- Leakage of environment variables and mounted secrets in containerized deployments.
- Facilitation of further attacks such as privilege escalation, lateral movement, or full server compromise using harvested secrets.
General mitigation guidance
Effective mitigation focuses on separating user-controlled data from backend file access and strictly constraining any local file operations:
- Design font upload and management flows so that the backend only processes raw uploaded data and never interprets user input as a local file path.
- When local resources must be referenced, use fixed identifiers mapped to a closed, server-side registry of allowed files rather than accepting arbitrary paths.
- Enforce strict path normalization and allowlisting, ensuring file access is confined to dedicated asset directories and cannot escape through
..segments or absolute paths. - Run the Penpot backend under a minimally privileged service account, with access only to the directories required for application operation.
- In containerized environments, avoid mounting sensitive host paths into the application container and minimize the secrets present on the filesystem.
How teams detect issues like this
Detection can combine code-level analysis with runtime monitoring:
- Static analysis and code review:
- Search for file reading APIs that consume parameters derived from RPC or HTTP request payloads.
- Flag patterns where user input is passed directly into file path constructors without allowlists or directory confinement.
- Review asset-handling and upload flows (e.g., fonts, media) to ensure they never treat user fields as local paths.
- Runtime and operational monitoring:
- Log accesses to sensitive filesystem locations and correlate them with font or asset creation operations.
- Monitor for unusual patterns where many different system files are read through the font creation endpoint.
- Policy enforcement:
- Apply secure coding guidelines that prohibit direct use of untrusted data in file path operations.
- Integrate automated scanning tools into CI/CD to detect path traversal and external file path control patterns.

