[pitboss] phase 10: Track J.8 + Track L.8 — PROTOTYPE_POLLUTION corpus + JS/TS prototype chain hook

This commit is contained in:
pitboss 2026-05-18 08:02:10 -05:00
parent 97e4dfff30
commit d8f88d97bb
20 changed files with 1406 additions and 22 deletions

View file

@ -0,0 +1,22 @@
// Phase 10 (Track J.8) — JavaScript PROTOTYPE_POLLUTION benign
// control fixture.
//
// The handler parses an attacker-controlled JSON string and walks
// it into a target constructed via `Object.create(null)`. Because
// the target has no prototype chain, even a payload whose top-level
// key is `__proto__` cannot reach `Object.prototype`. The harness's
// canary trap stays clear and no `PrototypePollution` probe is
// emitted.
const _ = require('lodash');
function deepMerge(target, source) {
return _.merge(target, source);
}
function run(payload) {
const parsed = JSON.parse(payload);
const target = Object.create(null);
return deepMerge(target, parsed);
}
module.exports = { run };

View file

@ -0,0 +1,20 @@
// Phase 10 (Track J.8) — JavaScript PROTOTYPE_POLLUTION vuln fixture.
//
// The handler parses an attacker-controlled JSON string and passes
// the parsed object into `lodash.merge` against a vanilla `{}`
// target. When the payload's top-level key is `__proto__`, the
// merge walks the key into `Object.prototype` and the harness's
// canary trap records a `ProbeKind::PrototypePollution` probe.
const _ = require('lodash');
function deepMerge(target, source) {
return _.merge(target, source);
}
function run(payload) {
const parsed = JSON.parse(payload);
const target = {};
return deepMerge(target, parsed);
}
module.exports = { run };

View file

@ -0,0 +1,17 @@
// Phase 10 (Track J.8) — TypeScript PROTOTYPE_POLLUTION benign
// control fixture.
//
// Uses `Object.create(null)` as the merge target so even a payload
// whose top-level key is `__proto__` cannot reach
// `Object.prototype`.
import * as _ from 'lodash';
export function deepMerge(target: any, source: any): any {
return (_ as any).merge(target, source);
}
export function run(payload: string): any {
const parsed = JSON.parse(payload);
const target: any = Object.create(null);
return deepMerge(target, parsed);
}

View file

@ -0,0 +1,16 @@
// Phase 10 (Track J.8) — TypeScript PROTOTYPE_POLLUTION vuln fixture.
//
// Same shape as the JS sibling: parse the attacker-controlled JSON
// string, deep-merge it into a vanilla `{}` target, get prototype
// pollution when the payload carries a `__proto__` key.
import * as _ from 'lodash';
export function deepMerge(target: any, source: any): any {
return (_ as any).merge(target, source);
}
export function run(payload: string): any {
const parsed = JSON.parse(payload);
const target: any = {};
return deepMerge(target, parsed);
}