[SECURITY][BUG] Enforce one strict JSON parser at the HTTP boundary #133
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Defect
Current
masterat8fb297d146e7332fae7e38170b5b49d49530ac53still has a strict-JSON boundary defect. The sharedparse-json-octetshelper now pre-validates with YASON and then reparses with JSOWN, but upstream YASON's object/array loops are themselves structurally permissive for trailing commas.This is a data-integrity/security boundary bug, not a feature request.
Preserved RED
Evidence-only PR #126 preserves the smallest deterministic object-trailing-comma regression.
a2368ba58d0347af8f85efd85aba7b021ded65b5TRAILING-COMMA-JSON-IS-A-400-CLIENT-ERRORhttp-input-error, HTTP 400, codemalformed_json,}is acceptedPreserve the RED. Do not xfail, skip, weaken, swallow, or bypass it.
Current-source finding
Current
source/frontends/http-boundary-core.lispalready owns the correct architectural seam:request octets -> content-type/byte limit -> parser -> route/schema -> application effectsThe defect is the parser authority inside that seam, not a need for route-specific checks.
Current
starintel-gserver.asdalready depends oncom.inuoe.jzon. Jzon provides RFC-8259-oriented parsing with explicit controls for comments, trailing commas, multiple top-level values, max depth and max string length, and accepts UTF-8 octets directly. Its streaming parser emits object-key events, allowing deterministic per-object duplicate-key rejection without another syntax parser.Canonical ARDR authority
Research:
lost-rob0t/starintel-auto-research/roam/research/star-server/STAR-RESEARCH-060-strict-json-http-boundary.orgDesign:
lost-rob0t/starintel-auto-research/roam/design/star-server/STAR-SERVER-060-strict-json-http-boundary.orgResearch lifecycle is
READY_FOR_DESIGN; design lifecycle isDESIGN_READY_FOR_OPERATOR_REVIEW.The research conclusion, architecture/design approval, and implementation authorization remain separate human-gated states. Implementation authorization is PENDING / AWAITING_OPERATOR_APPROVAL.
Design decision
Use exactly one strict syntax authority on caller bytes:
No StarLang, Sento, storage, lease, or unrelated API redesign belongs in this fix.
Proposed implementation slices — ALL PENDING OPERATOR APPROVAL
Slice 1 — strict syntax adapter + RED corpus
Keep the public
parse-json-octetsseam stable. Preserve #126 and add pure boundary fixtures for:RED-first target remains the #126 object trailing comma and must fail for the expected permissive-baseline behavior before production mutation.
Slice 2 — compatibility conversion
Prove object, array, string, number, true, false, null, empty object and empty array preserve the semantics current JSOWN-consuming handlers require. Do not assume
nilhas identical meaning across libraries.Slice 3 — route convergence and side-effect fencing
Audit all
source/frontends/http-*.lisprequest-body seams. Every caller-controlled JSON body must enter the common boundary exactly once. Malformed corpus cases must invoke zero downstream mutation/dispatch/publication/lease callbacks.Slice 4 — full verification
Run focused boundary tests, full deterministic local server gate, Nix/closure verification, container stack, schema lock and security-negative/ZAP checks. Capture the exact resolved Jzon dependency identity because it is present through the ASDF dependency graph but not separately pinned in
qlfile.lock.Acceptance criteria
malformed_json+ correlation behavior;Contradiction to keep visible
PR #126 recorded
[1,]as rejected in its resolved runtime, while the audited upstream YASON parser shape is permissive for both object and array trailing delimiters. Do not infer either behavior from source alone at realization time: the exact resolved local dependency closure must execute the hostile corpus.Refs #126, #105.