Skip to content
RCE Advisory Intermediate CVE-2021-21414

GHSL-2021-060: Command injection in @prisma/sdk - CVE-2021-21414

The getPackedPackage method in @prisma/sdk is vulnerable to command injection because it passes user input to a shell command without sanitisation. An attacker who controls input to this method could execute arbitrary commands on the host.

Alvaro Muñoz Follow

Originally disclosed on GitHub Security Lab

The getPackedPackage method has a command injection vulnerability. Clients of the @prisma/sdk library are unlikely to be aware of this, so they might unwittingly write code that contains a vulnerability.

pwntester, on GitHub Security Lab

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 report has not been written yet. The Original tab links to the source.

How it worked

Impact

This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input.

What the attacker needed

Client uses getPackedPackage with untrusted input

The fix

The issue was fixed and an advisory was published.

How it was found

  1. Install the @prisma/sdk package.
  2. Create a script that calls getPackedPackage with a malicious argument.
  3. Run the script and observe that a file is created, proving command execution.

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 report has not been written yet. The Original tab links to the source.

This is a library that other programs use. If a program passes untrusted input (like a username from a web form) into this library's function, an attacker could trick the system into running their own commands, like creating files or stealing data.

What is RCE?

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

More by Alvaro Muñoz

View all

132 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

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.