You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complete JSON document is redacted atomically before evidence is split into lines, while preserving valid JSON layout, duplicate-key order, scalar types, result markers, and bounded processing.
Current defect
The current redaction path splits text into lines before attempting structural JSON handling. A valid document such as:
{
"password":"<opaque-credential>"
}
can separate the sensitive key from its value, so line-local handling never associates them. Conventional json.loads also collapses duplicate object keys, which cannot prove duplicate-key or layout preservation.
This is distinct from the wrapper-recursion defect tracked for Draft #906.
Required repair
recognize and process a complete bounded JSON document before line splitting;
preserve whitespace/layout, duplicate-key order, scalar types, and stable result-marker/schema fields;
redact values selected by sensitive keys and supported opaque credential semantics even when key, colon, and value span lines;
cover escaped strings, arrays/objects, duplicate sensitive and benign keys, and multiple sensitive occurrences;
keep invalid/non-JSON text on the bounded general redaction path without leaking raw parser diagnostics;
retain depth/input-size/performance bounds and fail closed when a safe structural context cannot be established;
do not normalize/re-serialize evidence in a way that destroys diagnostic layout or silently drops duplicate keys.
Security design constraints
Use a bounded iterative token/span rewriter before line splitting. Preserve every untouched source slice; do not transform raw text with whole-value json.loads/dict/json.dumps or object_pairs_hook.
Process complete JSON and bounded JSON spans surrounded by prefixes/suffixes or multiple diagnostic records. A malformed structural candidate that can bridge key, colon, and value across lines fails closed rather than leaking through line-local fallback.
Decode key/string tokens only for classification. Preserve unchanged escape spelling, whitespace, CR/LF boundaries, duplicate-key order/count, punctuation, and stable result-marker/schema fields.
Preserve value categories under sensitive keys: string → "[REDACTED]"; integer/number → a zero value of the same JSON number category; boolean → false; null remains null; arrays/objects retain shape and recursively scrub scalar leaves.
Apply explicit input-byte, depth, token, string, replacement, and cumulative work limits. Limit breach or unsafe parser state returns bounded fail-closed evidence without raw input or exception text.
Keep redact_json_value() for already-materialized trusted result objects; raw-text layout preservation belongs only to the text path.
Test JSON command fields containing nested wrappers and shell operands containing JSON so neither parser assumes the other already handled the credential.
Outcome
A complete JSON document is redacted atomically before evidence is split into lines, while preserving valid JSON layout, duplicate-key order, scalar types, result markers, and bounded processing.
Current defect
The current redaction path splits text into lines before attempting structural JSON handling. A valid document such as:
{ "password" : "<opaque-credential>" }can separate the sensitive key from its value, so line-local handling never associates them. Conventional
json.loadsalso collapses duplicate object keys, which cannot prove duplicate-key or layout preservation.This is distinct from the wrapper-recursion defect tracked for Draft #906.
Required repair
Security design constraints
json.loads/dict/json.dumpsorobject_pairs_hook."[REDACTED]"; integer/number → a zero value of the same JSON number category; boolean →false;nullremainsnull; arrays/objects retain shape and recursively scrub scalar leaves.redact_json_value()for already-materialized trusted result objects; raw-text layout preservation belongs only to the text path.Acceptance
Related: #906.