This commit is contained in:
Eli Peter 2026-06-05 10:16:30 -05:00 committed by GitHub
parent 55247b7fcd
commit 991c84a1eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1464 changed files with 225448 additions and 1985 deletions

View file

@ -0,0 +1,10 @@
# Phase 11 (Track J.9) — Python JSON_PARSE benign control fixture.
#
# json.loads then merge into a fresh `dict` rather than mutating the
# shared sentinel, so the canary trap on `_SHARED` cannot fire.
import json
def run(value):
parsed = json.loads(value)
return dict(parsed)

View file

@ -0,0 +1,20 @@
# Phase 11 (Track J.9) — Python JSON_PARSE vuln fixture.
#
# json.loads the attacker bytes then mutate a shared sentinel via
# attribute pollution; the harness's instrumented setattr trap
# observes the `__nyx_canary` write.
import json
class _Sentinel:
pass
_SHARED = _Sentinel()
def run(value):
parsed = json.loads(value)
for k, v in parsed.items():
setattr(_SHARED, k, v)
return _SHARED