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.
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.
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
- Install the @prisma/sdk package.
- Create a script that calls getPackedPackage with a malicious argument.
- 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.