Skip to content
RCE Write-up Beginner

Wikimedia/svgtranslate 2.0.1 Remote Code Execution

The SVGTranslate application passed the user-supplied 'lang' parameter directly into a shell command without sanitisation, allowing an unauthenticated attacker to inject arbitrary commands. This could lead to full server compromise.

Valentin Lobstein Follow

Published on chocapikk.com

The application is vulnerable to unauthenticated remote code execution (RCE) due to improper handling of the lang parameter in the PNG generation process. The vulnerability arises from how shell commands are constructed and executed in the rendering service without proper sanitization.

Valentin Lobstein (@Chocapikk_), on chocapikk.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The 'lang' parameter is concatenated into a shell command string without escaping or validation, allowing command injection.

Impact

An unauthenticated attacker could execute arbitrary commands on the server, leading to full server compromise.

What the attacker needed

No authentication required; Network access to the API endpoint

The fix

The vulnerability was fixed in version 2.0.2 by escaping the 'lang' parameter or using array-based command execution.

How it was found

  1. Send a GET request to the API endpoint with a crafted 'lang' parameter containing a command separator and a command.
  2. The server executes the injected command and returns the output in the response.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The application builds a command to run a program that converts SVG images to PNG. It inserts the language code you provide directly into that command without checking it. An attacker can add extra commands after a semicolon, and the server will run them, giving the attacker control over the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.