[release-branch.go1.27] encoding/xml: fix depth processing in (*Decoder).unmarshal
(*Decoder).DecodeElement bypassed recursion depth guard by unilaterally
passing the constant 0 to (*Decoder).unmarshal. Previously, unmarshal
depth was tracked via a depth parameter passed down the call stack,
which manual loops inside custom UnmarshalXML methods could bypass.
This change simplifies depth tracking by maintaining a stack depth value
that is adjusted as start elements are pushed / popped. This eliminates
the need to reason about and synchronize two different values storing
the unmarshal depth.
Additionally, guarding (*Decoder).RawToken using parser stack state
broke streaming decoders reading tokens within open XML elements. This
change simplifies the guard by adding an explicit inUnmarshalXML flag.
Thanks to Moran Omer (GitHub: moraneus) for reporting this issue.
Updates #80481
Fixes CVE-2026-56859
Change-Id: I5e89ebe9101b03545520aba5ea99fbf15bdf0395
Reviewed-on: https://go-review.googlesource.com/c/go/+/803320
Reviewed-by: Roland Shoemaker <rol...@golang.org>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit ccb0514cb7ff74c1104579f7945a806630dac73e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/807680
Auto-Submit: Ian Alexander <ji...@google.com>
Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
Reviewed-by: Dmitri Shuralyov <dmit...@golang.org>
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[release-branch.go1.25] encoding/xml: fix depth processing in (*Decoder).unmarshal
(*Decoder).DecodeElement bypassed recursion depth guard by unilaterally
passing the constant 0 to (*Decoder).unmarshal. Previously, unmarshal
depth was tracked via a depth parameter passed down the call stack,
which manual loops inside custom UnmarshalXML methods could bypass.
This change simplifies depth tracking by maintaining a stack depth value
that is adjusted as start elements are pushed / popped. This eliminates
the need to reason about and synchronize two different values storing
the unmarshal depth.
Additionally, guarding (*Decoder).RawToken using parser stack state
broke streaming decoders reading tokens within open XML elements. This
change simplifies the guard by adding an explicit inUnmarshalXML flag.
Thanks to Moran Omer (GitHub: moraneus) for reporting this issue.
Updates #80481
Fixes #80627
Fixes CVE-2026-56859
Change-Id: I5e89ebe9101b03545520aba5ea99fbf15bdf0395
Reviewed-on: https://go-review.googlesource.com/c/go/+/803320
Reviewed-by: Roland Shoemaker <rol...@golang.org>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit ccb0514cb7ff74c1104579f7945a806630dac73e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/807520
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[release-branch.go1.26] encoding/xml: fix depth processing in (*Decoder).unmarshal
(*Decoder).DecodeElement bypassed recursion depth guard by unilaterally
passing the constant 0 to (*Decoder).unmarshal. Previously, unmarshal
depth was tracked via a depth parameter passed down the call stack,
which manual loops inside custom UnmarshalXML methods could bypass.
This change simplifies depth tracking by maintaining a stack depth value
that is adjusted as start elements are pushed / popped. This eliminates
the need to reason about and synchronize two different values storing
the unmarshal depth.
Additionally, guarding (*Decoder).RawToken using parser stack state
broke streaming decoders reading tokens within open XML elements. This
change simplifies the guard by adding an explicit inUnmarshalXML flag.
Thanks to Moran Omer (GitHub: moraneus) for reporting this issue.
Updates #80481
Fixes #80628
Fixes CVE-2026-56859
Change-Id: I5e89ebe9101b03545520aba5ea99fbf15bdf0395
Reviewed-on: https://go-review.googlesource.com/c/go/+/803320
Reviewed-by: Roland Shoemaker <rol...@golang.org>
LUCI-TryBot-Result: golang...@luci-project-accounts.iam.gserviceaccount.com <golang...@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit ccb0514cb7ff74c1104579f7945a806630dac73e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/807540
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |