Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336) #340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 24, 2024

update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336)

go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and
net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11
milestone on our issue tracker for details.

Hello gophers,

We have just released Go versions 1.23.5 and 1.22.11, minor point releases.

These minor releases include 2 security fixes following the security policy:

  • crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints

    A certificate with a URI which has a IPv6 address with a zone ID may
    incorrectly satisfy a URI name constraint that applies to the certificate
    chain.

    Certificates containing URIs are not permitted in the web PKI, so this
    only affects users of private PKIs which make use of URIs.

    Thanks to Juho Forsén of Mattermost for reporting this issue.

    This is CVE-2024-45341 and Go issue https://go.dev/issue/71156.

  • net/http: sensitive headers incorrectly sent after cross-domain redirect

    The HTTP client drops sensitive headers after following a cross-domain redirect.
    For example, a request to a.com/ containing an Authorization header which is
    redirected to b.com/ will not send that header to b.com.

    In the event that the client received a subsequent same-domain redirect, however,
    the sensitive headers would be restored. For example, a chain of redirects from
    a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization
    header to b.com/2.

    Thanks to Kyle Seely for reporting this issue.

    This is CVE-2024-45336 and Go issue https://go.dev/issue/70530.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah self-assigned this Oct 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.48%. Comparing base (1161e9c) to head (098e63a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #340      +/-   ##
==========================================
- Coverage   53.10%   52.48%   -0.63%     
==========================================
  Files           9       13       +4     
  Lines         676      684       +8     
==========================================
  Hits          359      359              
- Misses        272      280       +8     
  Partials       45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docker-bake.hcl Outdated Show resolved Hide resolved
@thaJeztah
Copy link
Member Author

Looks like CGO is unhappy with some things;

 > [linux/amd64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
0.568 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION=v0.8.2-6-gafc81a0 REVISION=afc81a08baa99a4edcb010b689b59620d9977137 DESTDIR=/out
0.595 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
25.69 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
27.84 # runtime/cgo
27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:47:6: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:49:10: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:69:9: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:71:3: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.85 make: *** [Makefile:27: build-secretservice] Error 1

@crazy-max
Copy link
Member

Looks like CGO is unhappy with some things;

 > [linux/amd64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
0.568 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION=v0.8.2-6-gafc81a0 REVISION=afc81a08baa99a4edcb010b689b59620d9977137 DESTDIR=/out
0.595 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
25.69 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
27.84 # runtime/cgo
27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:47:6: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:49:10: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:69:9: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:71:3: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.85 make: *** [Makefile:27: build-secretservice] Error 1

I think we need to set CGO_CFLAGS to -Wno-atomic-alignment

@thaJeztah thaJeztah changed the title update to go1.22.8 update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336) Jan 20, 2025
Makefile Outdated
Comment on lines 12 to 19
# prevent warnings; see https://github.com/docker/docker-credential-helpers/pull/340#issuecomment-2437593837
# gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
export CGO_CFLAGS = -Wno-atomic-alignment

# 10.11 is the minimum supported version for osxkeychain
export MACOSX_DEPLOYMENT_TARGET = 10.11
ifeq "$(shell go env GOOS)" "darwin"
export CGO_CFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
export CGO_CFLAGS = $(CGO_CFLAGS) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah; that trick didn't work;

Makefile:19: *** Recursive variable `CGO_CFLAGS' references itself (eventually).  Stop.
mkdir -p ./bin
Error: Process completed with exit code 2.

@thaJeztah
Copy link
Member Author

booh; still no dice, but different error now 😢

mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
35.66 ld.lld: error: undefined symbol: __atomic_store_4
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(_cgo_wait_runtime_init_done)
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(x_cgo_notify_runtime_init_done)
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(x_cgo_set_context_function)
35.66 clang: error: linker command failed with exit code 1 (use -v to see invocation)
35.66 
35.69 make: *** [Makefile:31: build-secretservice] Error 1

go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and
net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11
milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.22.11+label%3ACherryPickApproved
- full diff: golang/go@go1.22.10...go1.22.11

Hello gophers,

We have just released Go versions 1.23.5 and 1.22.11, minor point releases.

These minor releases include 2 security fixes following the security policy:

- crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints

  A certificate with a URI which has a IPv6 address with a zone ID may
  incorrectly satisfy a URI name constraint that applies to the certificate
  chain.

  Certificates containing URIs are not permitted in the web PKI, so this
  only affects users of private PKIs which make use of URIs.

  Thanks to Juho Forsén of Mattermost for reporting this issue.

  This is CVE-2024-45341 and Go issue https://go.dev/issue/71156.

- net/http: sensitive headers incorrectly sent after cross-domain redirect

  The HTTP client drops sensitive headers after following a cross-domain redirect.
  For example, a request to a.com/ containing an Authorization header which is
  redirected to b.com/ will not send that header to b.com.

  In the event that the client received a subsequent same-domain redirect, however,
  the sensitive headers would be restored. For example, a chain of redirects from
  a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization
  header to b.com/2.

  Thanks to Kyle Seely for reporting this issue.

  This is CVE-2024-45336 and Go issue https://go.dev/issue/70530.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants