Proof Portal

Projects

jsonparser

ProbeLabs36 findings · 123 requirements
Back to findings
Known issueKI-16

Delete with no key path returns an empty, non-aliasing slice (root-delete contract)

FixedFixedLow

This defect has been fixed and verified.

Introduced

When and where this issue first entered the codebase — the commit it traces back to.

Inception (latent from the first version)

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.

Reachability

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).

LowRated severity — the impact if this issue is exploited or hit.
why this rating
Risk-rated
risk area
Data Integrity
Security classification
Security-relevant
CVSS
CVSS 3.7· Lowv3.1CVSS: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.

Known issue reproducedprovesSYS-REQ-010
Run it yourself
go test -run TestDemoKI16 -count=1 .
Covers (3)
Last run Aug 3, 2026, 11:00 AM

Reproduction steps

Technical steps for your engineers to confirm the issue by hand.

  1. Check out the proof-demo showcase branch and build the package.
  2. Call jsonparser.Delete({"a":1}) with no key path — or run: go test -run TestDemoKI16 -count=1 .
  3. 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.

Tracing blast radius…

Touch this finding and you re-check 1 requirements · 2 code files · 7 tests.

Requirements (1)
Code files (2)
  • fuzz.go
  • parser.go
Tests (7)
  • 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.

Implementing code (4)
  • fuzz.go
    FuzzDelete
  • parser.go
    Delete
  • parser.go
    DeleteFound
  • parser.go
    isJSONWhitespace
Tests & evidence (8)
  • README.md
  • 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
Proof obligations (3)
empty_input

Behavior when inputs are absent, nil, zero-length, or blank.

  • nominal (required)obligation_evidence_test.go:168
malformed_input

Behavior when inputs are syntactically or structurally invalid.

  • negative (required)set_spec_test.go:166
  • nominal (required)set_spec_test.go:162
nil_safety

Behavior specified when inputs are nil, null, or zero-value.

  • negative (required)obligation_evidence_test.go:170
  • nominal (required)obligation_evidence_test.go:169

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.

Sign in to discuss this with the proof team.Sign in