Reject characters outside the base64 alphabet in contentEncoding #241
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 223 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.324
Real PR Conversation Timeline
1 comments
"Review active on #241"
general
weight: 0.35
bardrop
contentEncoding: base64accepts characters outside the base64 alphabetThe value is decoded with
base64.b64decode(value), and with the defaultvalidate=Falsethat drops every character outsideA-Za-z0-9+/=before decoding, so only the leftover characters have to form valid base64:RFC 4648 section 3.3 says decoders must reject data containing characters outside the alphabet, and the JSON-Schema-Test-Suite marks
%as invalid (draft7optional/content.json; that case only passes today because removing the%happens to leave a padding error). Content checks run on the data being validated, so a field declared as base64 can carry quotes, angle brackets, spaces or line breaks into code that expects the validated value to be plain base64, for example when it is put into adata:URL. Theif data == ""check after the decode compares bytes with a str and never fires, so input that decodes to nothing is not caught either.The decode now passes
validate=True. Over about 8.7M generated strings per version on Python 3.10 to 3.14, the new check never accepts a string the old one rejected and never accepts a character outside the alphabet (on 3.12 and later it also rejects misplaced=padding). Whitespace and line breaks are rejected too, so MIME-style wrapped base64 no longer validates. The cases added totests/test_string.py(draft 07 and 2019-09) fail onmasterand pass here, the full suite passes on Python 3.10 to 3.14, and pylint output is unchanged.CHANGELOG.txthas an entry under UNRELEASED.