Skip to content
RCE Write-up Advanced

(CVE-2021-0218) Junos OS lc_fetch_license_keys() command injection

The license-check daemon on Junos OS runs as root and contains a command injection flaw in its license update feature. An attacker with low privileges could use it to run commands with root privileges.

starlabs.sg

Published on starlabs.sg

The command injection exists in the license update feature. To update license, user run command request system license update in cli console.

The author, on starlabs.sg

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 license update path passes attacker-influenced input into a shell command without sanitising it, and the daemon runs as root.

Impact

A low-privileged attacker could execute commands with root privileges on the device.

What the attacker needed

Low-privileged access to the device; ability to run the license update command

How it was found

  1. Run the license update command from the CLI console.
  2. This triggers the mgd_update_license() function in the Junos actions library.

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.

A daemon is a background program that keeps running on a device. This one manages software licences and runs with the highest level of permission (root). Because it passes user-influenced input into a system command without cleaning it, someone with only a normal account could sneak in extra commands that then run as root.

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.