commit 075e9d41dc2f4842ae0050a11b7c576bba9284a4 [browse]
Author: Gopher Robot
Date: 2026-07-07 12:35:44 -07:00

[release-branch.go1.27] go1.27rc2

Change-Id: Iee4d231b5b040576ab9c1175ba726e03090fff7c
Reviewed-on: https://go-review.googlesource.com/c/go/+/797800
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>

commit a4f5d9bbdbdf42da7e2d7e976ac85753c4db5d75 [browse]
Author: Damien Neil
Date: 2026-05-26 13:59:05 -07:00

[release-branch.go1.27] os: properly handle trailing slashes in paths in Root

This change fixes a significant mechanism by which
operations in a Root can escape the root.

The implementation of Root on platforms supporting the openat
family of functions assumed that openat(parent, "f/", O_NOFOLLOW)
would not resolve symlinks in "f". This is not correct; the
trailing slash causes f to be resolved.

This permits Root operations to escape when the target filename
ends in a slash and the target is a symlink to a directory outside the
root. This does not permit directly accessing non-directory files
outside a root, since the trailing slash adds a requirement that the
target be a directory. However, under some circumstances an attacker
might exploit this flaw to access non-directory files outside
a root, for example by first renaming a directory outside the root
to a location within it and then accessing files within that directory.

This change adjusts Root's handling of slash-terminated paths.
Trailing slashes are removed from the path at the start of an
operation, and the presence of slashes is tracked as a boolean.
Slashes are never reattached to a path component.

In addition, the doInRoot helper function now automatically
handles trailing slashes in a POSIX-compatible fashion.
When a path ends in one or more slashes:
  - symlinks in the final component are resolved; and
  - the final path component after symlink resolutions
    must reference a directory.

This change also adds a new sets of tests to exercise Root's
behavior in a wider variety of circumstances. These tests
run through a matrix of file configurations, such as:
  - path "target", a regular file
  - path "dir/../target", a directory
  - path "target/", a symlink to "dir/../target/", which does not exist
  - etc.

These tests execute Root operations and the corresponding unrooted
operation, validate specific expected results for some configurations,
and verify that the rooted and unrooted versions of the operation
produce the same result.

Thanks to Mundur (https://github.com/M0nd0R) for reporting this issue.

Fixes #79005
Fixes CVE-2026-39822

Change-Id: I34072ab63f2367baf236592f11143f4e6a6a6964
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/4740
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/4820
Commit-Queue: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/797780
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>

commit 48cd0253afdd540979e2b08d9343f4b47d8fb508 [browse]
Author: Junyang Shao
Date: 2026-07-06 15:20:57 Z

[release-branch.go1.27] all: merge master (976f004) into release-branch.go1.27

Merge List:

+ 2026-07-06 976f0044da test : repair codegen/simd mask instructions test
+ 2026-07-02 65504872cb crypto/mldsa: remove hand-defined wycheproof structs
+ 2026-07-02 aa44f96d9f net/http: fix BenchmarkClientRequestHeaders header count failure
+ 2026-07-01 3d3798e7fb net/http/internal/http2: do not silently truncate large trailers

Change-Id: I0161a1a6a84146dd1dbaaac78f44024c9d34d5f6

commit 71b7a760b53b4e92682e72404309e4dec1cf5023 [browse]
Author: Junyang Shao
Date: 2026-07-01 18:42:51 Z

[release-branch.go1.27] all: merge master (821f3ff) into release-branch.go1.27

Merge List:

+ 2026-07-01 821f3ff7c8 Revert "net/http: apply header timeout to server's unencrypted HTTP/2 check"
+ 2026-07-01 375872b485 math/big: fix edge case float formatting
+ 2026-07-01 d90bf6d722 net/http: add Server.MaxHeaderValueCount setting
+ 2026-07-01 9e5cf808f6 simd: correct two errors in formatting code, standardize emulation
+ 2026-06-30 1952e618b8 net/http: apply header timeout to server's unencrypted HTTP/2 check
+ 2026-06-30 2e82d2ce86 internal/runtime/maps: document hashing of stack pointers
+ 2026-06-30 686bbb7f9a net: fix TestLookupCNAME
+ 2026-06-30 11c4fcb72c simd: repaired emulation String methods for simd
+ 2026-06-30 8dcb3171f6 cmd/compile: fix misscompile in rewrite generic rules
+ 2026-06-30 3233439691 Revert "cmd/compile: speedup large init function compile time"
+ 2026-06-30 2f81c9e5d0 cmd/internal/objfile: fix PE BSS symbol classification
+ 2026-06-29 06bb174f89 net/http: prevent server from draining request body if status 100 was not sent
+ 2026-06-29 9a9246555f Revert "net/http/httputil: wrap ReverseProxy's outbound request body so Close is a noop"
+ 2026-06-29 54719fce02 simd: repair renaming of Mask.ToIntNs
+ 2026-06-26 6565f5517e cmd/compile: repair mask optimizations
+ 2026-06-26 137b8065ab crypto/tls: omit PSK in ECH outer client hello
+ 2026-06-25 76d509e948 math/rand/v2: document PCG and ChaCha8 tradeoffs
+ 2026-06-25 63b51fc270 runtime: lock M for the entire fast path
+ 2026-06-25 fe4da8e5c5 runtime: unify mallocStub fast/slow blocks
+ 2026-06-25 28279274c8 go/types, types2: improve error message for incomplete alias hashing
+ 2026-06-25 3aeef4896d os: test and fix ReadDir("/dev/fd") on macOS
+ 2026-06-25 5703e108de cmd/internal/objfile: use 'B' code for ELF and PE BSS symbols
+ 2026-06-25 48bf92284c cmd/compile, simd/archsimd: make Wasm Get/SetElem work for out-of-bound constants
+ 2026-06-25 0f0fb7add0 simd/archsimd: rename arm64 test files
+ 2026-06-25 b350da230f simd/archsimd: deduplicate simd_test.go and arm64_simd_test.go
+ 2026-06-25 e233bce82f simd/archsimd: deduplicate ternary test helpers
+ 2026-06-24 649897800b runtime: handle nil pointer in sysFreeOS on sbrk platforms
+ 2026-06-24 104f868a02 cmd/link: quote PE .def library name
+ 2026-06-24 29c1c946aa runtime: deconflict gscan and mutex profiler
+ 2026-06-24 cdf96936c0 simd/archsimd: deduplicate conversion test helpers
+ 2026-06-24 0d0822bdcb internal/nettest: fix flake in TestConnPartialWrite
+ 2026-06-23 c996ed1abc simd/archsimd: deduplicate shift tests
+ 2026-06-23 a2b3c73f75 simd/archsimd: correct ARM64 IfElse semantics
+ 2026-06-23 2a4fbc3f24 cmd/compile: fix invalid code generation for OINDEXMAP
+ 2026-06-23 9c9e880fe1 cmd/compile: don't require Heapaddr for heap vars in dead code
+ 2026-06-23 c433e4242e crypto/x509: triage x509limbo allows
+ 2026-06-23 431520e3bc crypto/internal/cryptotest: x509-limbo test coverage
+ 2026-06-23 674ceb7c7b types2, go/types: fix conversion error for pointer to type param
+ 2026-06-23 c554c53ac8 simd/archsimd: deduplicate tests
+ 2026-06-23 2f457b96a9 crypto/internal/cryptotest: parse go mod download JSON from stdout
+ 2026-06-22 57f9a589b5 net/http: preserve path escaping in redirects
+ 2026-06-22 40f0f81255 encoding/json/v2: report error when unmarshaling into ambiguous set of fields
+ 2026-06-22 5e685ce958 encoding/json/v2: improve documentation
+ 2026-06-22 e296659b12 cmd/compile: plumb PGO profile through inliner and body reader
+ 2026-06-22 61796ad8af os: remap / to \ in Windows os.Root.Symlink targets
+ 2026-06-22 d6427ef53e crypto/tls: document that ConnectionState is valid only after handshake
+ 2026-06-22 97b2becb4e log/slog: remove obsolete comment
+ 2026-06-22 9d758c06ef fmt: fix %q verb documentation to say "rune literal"
+ 2026-06-19 fd6f414c65 os/signal: avoid flaky TestCtrlBreak by waiting for child stdout
+ 2026-06-19 a2fd613c3e runtime: fix softfloat64 add/sub for normal operands cancelling to subnormal
+ 2026-06-18 6d1bcd1009 simd: set GOEXPERIMENT in testdata tests
+ 2026-06-18 642abeced6 simd: repair missed StorePart-returns-int in generated code
+ 2026-06-18 86f1f775f3 math/big: Float.Text result may not match strconv.FormatFloat result

Change-Id: I91b13faae148d2c0d37e4e520a6d638c898b667a

commit eefb454307250192f45fa3718685e4c0a90e281d [browse]
Author: Gopher Robot
Date: 2026-06-18 12:39:38 -07:00

[release-branch.go1.27] go1.27rc1

Change-Id: I140d62e6b20672d5e0283f042338017997fe1c69
Reviewed-on: https://go-review.googlesource.com/c/go/+/792340
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Auto-Submit: Gopher Robot <gobot@golang.org>

clone the repository to get more history