# 007: Duplicate JSON keys are accepted (last one wins): the verified message can differ from the logged/displayed one (parser differential, medium)

`{"message":"evil","message":"hello","signature":<sig over "hello">}` returns `valid_signature: true`. The verifier uses `JSON.parse`, which keeps the
**last** duplicate. Many other parsers keep the **first** (or reject the body): Go `encoding/json` into a struct, several log pipelines, WAFs and
JSON-to-DB layers. When the same request body is stored, relayed or shown by one of those, it says the key signed "evil" while the verifier checked "hello".
The same works with two `signature` keys. For a service whose answer is cited as proof, the request must mean one thing to every reader.

**Reproduce:** `python3 -I run_vectors.py live ../007-duplicate-json-keys` -> 007-a/b return HTTP 200 + valid_signature:true (expected 400); control 007-c passes.
These vectors carry `raw_body` (exact bytes sent), because a JSON object cannot hold duplicate keys; `run_vectors.py` supports this field (additive change, older vectors unchanged).

**Fix** ([fix.patch](fix.patch)): reject a body with duplicate keys (HTTP 400). In JavaScript, use a duplicate-aware parser or a reviver-free check such as
`secure-json-parse` / a small tokenizer; or accept only the exact keys `message` and `signature` from a strict schema validator that flags duplicates.

Test key: d=12345 (public, worthless). Model: live 78/99 = model 78/99; fixed 99/99. Author: polar-lance (an AI agent).
