Summary
A critical OS command injection vulnerability in Penpot's SVG exporter allows attacker-controlled text color data to become part of a shell command. An attacker who can edit a design file, or access a malicious file through a valid public share link, may execute commands with the exporter service's privileges when SVG export is triggered.
A critical OS command injection vulnerability in Penpot's SVG exporter allows attacker-controlled text color data to become part of a shell command. An attacker who can edit a design file, or access a malicious file through a valid public share link, may execute commands with the exporter service's privileges when SVG export is triggered.
Affected context
The vulnerability occurs in Penpot deployments that use the SVG export functionality and process attacker-controlled text-object styling values. It becomes risky when a user can edit or share a crafted design file and the exporter constructs commands from those values without treating them strictly as data.
The vulnerability occurs in Penpot deployments that use the SVG export functionality and process attacker-controlled text-object styling values. It becomes risky when a user can edit or share a crafted design file and the exporter constructs commands from those values without treating them strictly as data.
Exploit preconditions
- Attack surface: Penpot's SVG export service and its command-line image-processing workflow
- Required access: Ability to edit a design file or provide a malicious file through an accessible public share link
- Trigger point: SVG export of a file containing a crafted text object's fill-color value
- Why exploitation is possible: The exporter incorporates attacker-controlled data into a command string executed by a child process
- Attack surface: Penpot's SVG export service and its command-line image-processing workflow
- Required access: Ability to edit a design file or provide a malicious file through an accessible public share link
- Trigger point: SVG export of a file containing a crafted text object's fill-color value
- Why exploitation is possible: The exporter incorporates attacker-controlled data into a command string executed by a child process
Why this happens
The underlying flaw is command construction from untrusted input. A user-controlled fill-color value is inserted into a shell command and passed to a process-execution API that interprets shell syntax, rather than being supplied as a safely separated argument.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because input is allowed to influence command interpretation without adequate validation, escaping, or process isolation.
The underlying flaw is command construction from untrusted input. A user-controlled fill-color value is inserted into a shell command and passed to a process-execution API that interprets shell syntax, rather than being supplied as a safely separated argument.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because input is allowed to influence command interpretation without adequate validation, escaping, or process isolation.
Potential impact
- An attacker may execute arbitrary commands as the exporter service account.
- The attacker could access or alter files available to the exporter process.
- The compromise could enable theft or manipulation of design assets and service secrets.
- The attacker could use the service as a foothold for lateral movement, depending on runtime permissions and network access.
- Availability of export services could be disrupted.
- An attacker may execute arbitrary commands as the exporter service account.
- The attacker could access or alter files available to the exporter process.
- The compromise could enable theft or manipulation of design assets and service secrets.
- The attacker could use the service as a foothold for lateral movement, depending on runtime permissions and network access.
- Availability of export services could be disrupted.
General mitigation guidance
Mitigation generally focuses on ensuring that user-controlled values never become shell syntax.
Common defensive patterns include:
- Prefer direct process-spawning APIs that pass a fixed executable and an argument array without shell interpretation.
- Validate color values against a strict allowlist or canonical format before processing.
- Keep command templates fixed and separate data from executable arguments.
- Run export workers with least-privilege identities, restricted filesystem access, and limited network permissions.
- Apply container and process isolation so an exporter compromise has a constrained blast radius.
- Treat public share links and imported design files as untrusted input and apply equivalent validation paths.
- Maintain vendor-provided security fixes through the organization's normal secure release process.
Mitigation generally focuses on ensuring that user-controlled values never become shell syntax.
Common defensive patterns include:
- Prefer direct process-spawning APIs that pass a fixed executable and an argument array without shell interpretation.
- Validate color values against a strict allowlist or canonical format before processing.
- Keep command templates fixed and separate data from executable arguments.
- Run export workers with least-privilege identities, restricted filesystem access, and limited network permissions.
- Apply container and process isolation so an exporter compromise has a constrained blast radius.
- Treat public share links and imported design files as untrusted input and apply equivalent validation paths.
- Maintain vendor-provided security fixes through the organization's normal secure release process.
How teams detect issues like this
Organizations can identify similar issues through:
- Static analysis for shell command construction involving string concatenation or interpolation.
- Searches for child-process APIs that invoke shells or execute dynamically assembled command strings.
- Code review checks ensuring user-controlled design properties are validated before reaching process execution.
- Tests using malformed or unexpected property values to confirm that export workflows do not interpret shell syntax.
- Runtime monitoring for unusual child processes, command interpreters, outbound connections, or filesystem access from exporter workers.
- Policy enforcement requiring argument-array process APIs and prohibiting shell execution for user-influenced data.
Automated code review and software composition tools may help flag risky process-execution patterns, but findings should be confirmed against the actual data flow.
Organizations can identify similar issues through:
- Static analysis for shell command construction involving string concatenation or interpolation.
- Searches for child-process APIs that invoke shells or execute dynamically assembled command strings.
- Code review checks ensuring user-controlled design properties are validated before reaching process execution.
- Tests using malformed or unexpected property values to confirm that export workflows do not interpret shell syntax.
- Runtime monitoring for unusual child processes, command interpreters, outbound connections, or filesystem access from exporter workers.
- Policy enforcement requiring argument-array process APIs and prohibiting shell execution for user-influenced data.
Automated code review and software composition tools may help flag risky process-execution patterns, but findings should be confirmed against the actual data flow.

