← Back to Pull requests

user: limit reads when parsing passwd and group files #286

Closed
unknown closed this pull request without merging on Nov 23, 2026 20:04 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 15:35 UTC
Author

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.

Diff: 262 lines (+196 / -66) across 3 files Reviewer: vvoland Review duration: 269m
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
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.3% (MEDIUM) · Higher = larger blast radius
39.3%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.5% · Safe to merge
15.5%
Repository