Legacy JSONL decoder accepts leading-zero numbers #632

Closed
opened 2026-10-20 19:40:20 +02:00 by erikinkinen · 0 comments
Owner

Problem

The legacy JSONL parser accepts leading-zero numeric literals. At 4cbd403dc207c46f8b21273b141d16b2470105e9, changing the first canonical v3 fixture record from "v":3 to "v":03 still returns a successful EventLogRecord. JSON integers do not permit a leading zero before another digit. This weakens the strict log boundary needed before research event replay.

Reproduction

Use decode_event_log_record_jsonl on the first record of tests/fixtures/legacy_phase1/root_revoke/direct/v3/events.jsonl, then insert 0 immediately after "v":. The probe prints canonical_accepted=1 leading_zero_accepted=1 and exits 1. The standalone probe and output are retained in the local execution audit; a regression test will cover all supported legacy schema versions.

Scope

Reject non-JSON numeric spelling and audit JSON whitespace recognition at the same lexical boundary. Preserve canonical legacy encodings, event semantics, archived fixture bytes and the separate version-4 implementation. Malformed input must return ParseError without partial records.

Steps

  • Reproduce lexical rejection failures with focused regression cases across legacy versions 0–3.
  • Tighten the lexical parser while preserving canonical legacy round trips and fixture outputs.
  • Pass the complete Debug, Release, sanitizer and final PR-head CI checks; archive evidence.
## Problem The legacy JSONL parser accepts leading-zero numeric literals. At `4cbd403dc207c46f8b21273b141d16b2470105e9`, changing the first canonical v3 fixture record from `"v":3` to `"v":03` still returns a successful EventLogRecord. JSON integers do not permit a leading zero before another digit. This weakens the strict log boundary needed before research event replay. ## Reproduction Use `decode_event_log_record_jsonl` on the first record of `tests/fixtures/legacy_phase1/root_revoke/direct/v3/events.jsonl`, then insert `0` immediately after `"v":`. The probe prints `canonical_accepted=1 leading_zero_accepted=1` and exits 1. The standalone probe and output are retained in the local execution audit; a regression test will cover all supported legacy schema versions. ## Scope Reject non-JSON numeric spelling and audit JSON whitespace recognition at the same lexical boundary. Preserve canonical legacy encodings, event semantics, archived fixture bytes and the separate version-4 implementation. Malformed input must return ParseError without partial records. ## Steps - [x] Reproduce lexical rejection failures with focused regression cases across legacy versions 0–3. - [x] Tighten the lexical parser while preserving canonical legacy round trips and fixture outputs. - [x] Pass the complete Debug, Release, sanitizer and final PR-head CI checks; archive evidence.
erikinkinen added this to the Phase 2 milestone 2026-10-20 19:40:20 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erikinkinen/AES#632
No description provided.