Proof Portal
jsonparser
ProbeLabs36 findings · 123 requirementsDelete with no key path returns an empty, non-aliasing slice (root-delete contract)
This defect has been fixed and verified.
Introduced
When and where this issue first entered the codebase — the commit it traces back to.
Affected requirements
The requirement(s) this issue violates — click through to the spec.
What this means for you
Plain-language impact — what this issue could mean for your users and your system, before any of the technical detail.
Deleting with an empty key path yields an empty document backed by fresh memory, so callers can safely mutate the result without corrupting their original input. This entry documents already-correct behavior with a green reproducer on the proof-demo showcase branch; never shipped.
Reachable via Delete/DeleteFound with no keys; the guard now returns a fresh empty slice, so the reproducer is green.
Technical description
deleteFoundConfig (parser.go) defines the root-delete contract: with no key path the whole document is deleted. The no-path guard at parser.go:1256 (`if lk == 0 { return make([]byte, 0), true }`) returns a fresh zero-length slice with a fresh backing array and found=true, so the result does not alias the caller's input buffer. Returning the aliased input slice instead would be a CWE-1325/aliasing hazard (later writes to the returned slice could mutate the caller's data). This entry documents the already-correct, hardened behavior with a GREEN reproducer; the tripwire fires if the guard is removed or made to alias. Intentional demo showcase entry on the proof-demo branch; never shipped.
Severity, explained
Why this is rated the way it is — and the scoring signals behind the rating (each ⓘ explains the term).
- why this rating
- Risk-rated
- risk area
- Data Integrity
- CVSS
- CVSS 3.7· Lowv3.1
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N - CVE surface
- None
Where it is
The code the issue lives in — peek the affected function inline to see it in context.
- deleteFoundConfig
How it's proven
The reproducer — an actual test that drives the real code and shows the issue happening. Run it yourself, or peek the test and the source it covers.
go test -run TestDemoKI16 -count=1 .
Reproduction steps
Technical steps for your engineers to confirm the issue by hand.
- Check out the proof-demo showcase branch and build the package.
- Call jsonparser.Delete({"a":1}) with no key path — or run: go test -run TestDemoKI16 -count=1 .
- Observe an empty result slice, found=true, whose backing array is distinct from the input; the reproducer is green.
go test -run TestDemoKI16 -count=1 . go test ./... -count=1
How it can be triggered
The input or condition that sets this issue off.
a Delete call with an empty (zero-length) key path over any document, e.g. Delete({"a":1})
What protects you, and the fix
What limits your exposure today, and the planned remediation.
What protects you now
No action needed for users — the root-delete path already returns a fresh, non-aliasing empty slice.
The fix
No further action required: the no-path guard (parser.go:1256) is present and correct, returning a fresh zero-length slice for the root-delete case. This KI documents the resolved, non-aliasing behavior (guards against a CWE-704/aliasing hazard).
Blast radius
If you touch this issue, what else may need re-checking — the requirements it affects and the code and tests that hang off them.
Touch this finding and you re-check 1 requirements · 2 code files · 7 tests.
- fuzz.go
- parser.go
- coverage_closure_test.go
- dead_code_audit_test.go
- issues_56_107_229_test.go
- obligation_evidence_test.go
- parser_test.go
- set_spec_test.go
- v131_regression_test.go
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Per-requirement evidence
For each requirement this finding touches: the implementing code, verifying tests, and proof obligations that discharge it.
Evidence trail
The raw evidence manifests behind this finding — superseded by the resolved reproducer above, kept here for traceability.
Evidence trail
The raw evidence manifests behind this finding — superseded by the resolved reproducer above, kept here for traceability.
- proof/evidence/KI-16-reproducer.yaml
Discussions
Discuss this with the proof team. Nothing changes in your audit automatically — you open a request and a staff member records any outcome inside the thread.