user: limit reads when parsing passwd and group files #286
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 262 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.333
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #286"
general
weight: 0.35
vvoland
user: limit reads when parsing passwd files
Use the existing openUserFile helper in ParsePasswdFileFilter to limit reads
to 10 MiB and reject non-regular files. This extends the protection introduced
in bba2f13154cb6 for group files to passwd files, which may also originate
from untrusted container images.
See: https://github.com/moby/sys/commit/bba2f13154cb607bfbc7e209f8d9100ef4000329
user: limit reads when looking up additional groups
Use the existing openUserFile helper in GetAdditionalGroupsPath to limit reads
to 10 MiB and reject non-regular files. This extends the protection introduced
in bba2f13154cb6 to additional group lookups, which may also read group files
from untrusted container images.
Preserve the existing behavior for missing group files, but propagate other
errors instead of silently ignoring them.
See: https://github.com/moby/sys/commit/bba2f13154cb607bfbc7e209f8d9100ef4000329
user: limit reads when parsing subordinate ID files
Use the existing openUserFile helper in ParseSubIDFileFilter to limit reads
to 10 MiB and reject non-regular files. This extends the protection introduced
in bba2f13154cb6 to subordinate UID/GID files, which may also originate
from untrusted sources.
See: https://github.com/moby/sys/commit/bba2f13154cb607bfbc7e209f8d9100ef4000329
user: limit reads when looking up users and groups
Use ParsePasswdFileFilter and ParseGroupFileFilter for user and group lookups
instead of opening and parsing the files directly. This reuses the existing
10 MiB read limit and regular-file checks introduced in bba2f13154cb6 and
extended to passwd files.
See: https://github.com/moby/sys/commit/bba2f13154cb607bfbc7e209f8d9100ef4000329
user: document unrestricted passwd and group readers
Add GoDoc comments to GetPasswdPath, GetGroupPath, GetPasswd, and GetGroup.
Clarify that GetPasswd and GetGroup return unrestricted readers without
validating the file type or limiting reads, unlike the file-based parsing
functions. Callers are responsible for closing the returned readers and
handling potentially unbounded input.