본문으로 건너뛰기
cccskills
무료GitHub에 공개

method-clobbering

Detect method clobbering via user-controlled object keys that overwrite built-in methods like toString, valueOf, or hasOwnProperty, causing crashes or logic bypass.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(4)

  • SKILL.md3.7 KB
  • references/false-positive-indicators.md1.1 KB
  • references/poc-skeleton.md1.4 KB
  • references/sinks.md1.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Method Clobbering Detection

When to Use

Audit CSV/form/query string parsers that create plain objects from untrusted input where the attacker can control property names (keys), not just values.

Key Insight

When a parser creates a plain object {} from user input, the attacker can set keys like toString, valueOf, hasOwnProperty to non-function values. Any code that later calls these methods on the object will throw a TypeError.

Important: JSON.parse can do the same thing. You MUST show why the library-specific clobbering is worse than what JSON.parse enables. Show a REAL crash path, not just theoretical property overwrite.

Dangerous Keys

KeyNormal TypeEffect When Clobbered
toStringFunctionobj + "" throws TypeError
valueOfFunctionobj == x or coercion throws TypeError
hasOwnPropertyFunctionobj.hasOwnProperty(k) throws TypeError
constructorFunctionType checks fail
__proto__ObjectPrototype pollution (see prototype-pollution skill)
__defineGetter__FunctionLegacy getter/setter manipulation
__defineSetter__FunctionLegacy getter/setter manipulation
__lookupGetter__FunctionLegacy getter/setter introspection
toJSONundefinedJSON.stringify(obj) throws TypeError
thenundefinedawait obj or Promise.resolve(obj) treats obj as thenable

Process

Step 1: Find Parsers That Create Objects

grep -rn "\[key\]\s*=" . --include="*.js" --include="*.ts"
grep -rn "\[header\]\|\[field\]\|\[name\]\|\[prop\]" .
grep -rn "result\[\|output\[\|obj\[\|data\[\|parsed\[" .

Step 2: Check If Keys Are User-Controlled

Common sources of attacker-controlled keys:

  • CSV column headers (first row)
  • HTTP form field names
  • Query string parameter names
  • Configuration file keys
  • JSON object keys (but JSON.parse already handles this)

Step 3: Check for Key Filtering

grep -rn "Object\.create(null)" .  # Null prototype = safe
grep -rn "hasOwnProperty\|toString\|valueOf" . | grep -i "filter\|block\|skip"
grep -rn "Object\.keys\|Map\|new Map" .

Step 4: Demonstrate Real Impact

You MUST show one of:

  1. TypeError crash: Code calls obj.toString() or obj.hasOwnProperty() on the parsed result
  2. Logic bypass: Code checks obj.hasOwnProperty(x) for security decisions
  3. Thenable confusion: Code uses await or Promise.resolve() on the parsed object
# Find code that calls methods on parsed objects
grep -rn "\.toString()\|\.valueOf()\|\.hasOwnProperty(" .
grep -rn "JSON\.stringify(" .  # Uses toJSON
grep -rn "await\|Promise\.resolve" .  # Uses then

CVSS Guidance

  • TypeError crash causing DoS (unauthenticated): HIGH 7.5
  • Logic bypass via hasOwnProperty clobbering: HIGH 7.5
  • Thenable confusion: MEDIUM 5.3-6.5
  • No demonstrated crash/bypass: likely rejected

Self-Check Before Reporting

  1. Can JSON.parse achieve the same clobbering? If yes, why is this worse?
  2. Does code actually call methods on the parsed object?
  3. Is the crash catchable (try/catch around it)?
  4. Is the parser documented as expecting trusted input?

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

You are helping a penetration tester exploit misconfigured Active Directory

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

You are helping a penetration tester enumerate an Active Directory domain and

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

You are helping a penetration tester establish persistent access in Active

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

You are helping a penetration tester exploit ADCS through template/CA access

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

You are helping a penetration tester establish persistence through AD CS

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

You are helping a penetration tester exploit misconfigured AD CS certificate

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ajtazer/heckit22026년 10월 7일 업데이트

ajtazer의 스킬 모두 보기

이 스킬의 문제 신고