Skip to content

Conversation

@AkihiroSuda
Copy link
Member

These strings were resolved using the user information on the host filesystem and were decreasing reproducibility.

For :

archive/tar.go Outdated
Comment on lines 605 to 610
// uname and gname strings are from the host filesystem and meaningless for containers
// (https://github.com/moby/buildkit/issues/3688)
hdr.Uname = ""
hdr.Gname = ""
Copy link
Member

@thaJeztah thaJeztah Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we disable the lookup altogether? In moby/moby we previously had a fork of pkg/archive to disable lookup of usernames (related to CVE-2019-14271 / GHSA-v2cv-wwxq-qq97), but in moby/moby@e9bbc41, we implemented a new approach to disable it (while using Go's stdlib)

/cc @corhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the benefit compared to just unsetting uname and gname? (slightly faster?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ISTR the lookup not just looks up in /etc/passwd, but (depending on the host) also looks up in other ways.

Not sure if it applies to this as well, but I recall cases on Windows where this could even result in connecting to Active Directory (something which has been known to cause 10 seconds or more delays in some setups).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@k8s-ci-robot
Copy link

@thaJeztah: GitHub didn't allow me to request PR reviews from the following users: corhere.

Note that only containerd members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

Should we disable the lookup altogether? In moby/moby we previously had a fork of pkg/archive to disable lookup of usernames (related to GHSA-v2cv-wwxq-qq97), but in moby/moby@e9bbc41, we implemented a new approach to disable it (while using Go's stdlib)

/cc @corhere

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thaJeztah
Copy link
Member

only nit: should the commit message reflect the latest changes (e.g., "disable user-lookup ...")?

These strings were resolved using the user information on the host
filesystem and were decreasing reproducibility.

For moby/buildkit issue 3688

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda force-pushed the archive-discard-uname-gname branch from a4cac89 to d26587c Compare March 7, 2023 17:07
@AkihiroSuda AkihiroSuda changed the title archive: truncate uname and gname strings archive: disable looking up usernames and groupnames on the host Mar 7, 2023
@AkihiroSuda
Copy link
Member Author

(Do we need to assign a CVE for that we were leaking user names on the host? 🤔 )

@thaJeztah
Copy link
Member

(Do we need to assign a CVE for that we were leaking user names on the host? 🤔 )

Not sure if needed; it seems very minimal.

If we would, then the CVE should probably be for Go itself for including this information by default (and until recently no good way to disable it)

@kzys kzys merged commit 29e10a1 into containerd:main Mar 7, 2023
@thaJeztah thaJeztah added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch and removed cherry-pick/1.6.x labels Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants