Skip to content
RCE Write-up Intermediate

Symantec Web Gateway <= 5.2.1 (restore.php) OS Command Injection Vulnerability

The restore.php script in Symantec Web Gateway passes a user-supplied uploaded filename into shell commands without sanitising it. An attacker could inject operating system commands through the filename and have them executed on the server.

karmainsecurity.com

Published on karmainsecurity.com

User input passed via the filename of uploaded files is not properly sanitised before being used in a call to the syscall() function at line 86. This can be exploited to inject and execute arbitrary OS commands with the privileges of the “root” user on the appliance.

The author, on karmainsecurity.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

Likely the uploaded file's original name is placed directly into shell command strings without escaping or validation, so shell metacharacters in the name are interpreted as commands.

What the attacker needed

Access to the restore upload feature

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.

When you upload a file, the server takes the file's name and uses it inside a command it runs on the machine. If the name contains special shell characters, the server may run extra commands the attacker chose. This lets an attacker run their own commands on the server, which is very serious.

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.