Repository navigation
Conversation
full diff: moby/sys@user/v0.4.1...user/v0.5.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit a2a9fec) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Security This release includes fixes for unbounded reads when parsing user, group, and ID mapping files, which could lead to excessive resource consumption and denial of service. For details, see [CVE-2026-135844] / [GHSA-ffh6-8jcg-cjmw]. What's changed - user: stricter parsing - user: limit reads when parsing passwd and group files - user: limit reads when parsing ID mapping files - user: mkdirAs: refactor and touch-up comments for clarity full diff: moby/sys@user/v0.5.0...user/v0.5.1 [CVE-2026-135844]: https://www.cve.org/CVERecord?id=CVE-2026-135844 [GHSA-ffh6-8jcg-cjmw]: https://github.com/moby/sys/security/advisories/GHSA-ffh6-8jcg-cjmw Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 21c1b43) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
|
|
||
| if gid != rgid { | ||
| rgid, err = toHost(gid, i.GIDMaps) | ||
| ruid, err := toHost(uid, i.UIDMaps) |
There was a problem hiding this comment.
[medium] ToHost no longer short-circuits on the mapped root pair, changing behavior for empty non-nil ID maps
The old ToHost implementation had an explicit short-circuit: if the requested uid already equalled the remapped root UID (ruid := i.RootPair()), it skipped calling toHost and returned the root pair directly. The new implementation unconditionally calls toHost(uid, i.UIDMaps) for every UID.
The difference matters when UIDMaps (or GIDMaps) is a non-nil but empty slice ([]IDMap{}). In toHost, the nil-map case explicitly returns the input as-is (identity), but a non-nil empty slice falls through the range loop and returns (-1, error):
func toHost(contID int, idMap []IDMap) (int, error) {
if idMap == nil { // nil → identity ✓
return contID, nil
}
for _, m := range idMap { // non-nil empty → loop never runs → falls through
...
}
return -1, fmt.Errorf("container ID %d cannot be mapped to a host ID", contID)
}The new doc comment says "An empty mapping is treated as identity", but the implementation only treats nil as identity — a non-nil empty slice causes an error. Any caller that constructs IdentityMapping{UIDMaps: []IDMap{}, GIDMaps: []IDMap{}} (e.g. via JSON unmarshalling of {"UIDMaps": [], "GIDMaps": []}) would have gotten (0, 0, nil) from the old code but now gets (-1, -1, error).
Consider aligning the implementation with the comment by treating a non-nil empty slice the same as nil inside toHost:
func toHost(contID int, idMap []IDMap) (int, error) {
if len(idMap) == 0 { // nil or empty → identity
return contID, nil
}
...
}| Confidence | Score |
|---|---|
| 🟡 moderate | 67/100 |
docker-agent
left a comment
There was a problem hiding this comment.
vendor: github.com/moby/sys/user v0.5.1
Security
This release includes fixes for unbounded reads when parsing user, group,
and ID mapping files, which could lead to excessive resource consumption
and denial of service.
For details, see CVE-2026-135844 / GHSA-ffh6-8jcg-cjmw.
What's changed
full diff: moby/sys@user/v0.5.0...user/v0.5.1
vendor: github.com/moby/sys/user v0.5.0
full diff: moby/sys@user/v0.4.1...user/v0.5.0
Summary
Release notes (optional)
A picture of a cute animal (not mandatory but encouraged)