Skip to content

chore(deps): Update module github.com/apache/thrift to v0.23.0 [SECURITY] (release-3.7.x)#21778

Open
renovate-sh-app[bot] wants to merge 1 commit intorelease-3.7.xfrom
deps-update/release-3.7.x-go-github.com-apache-thrift-vulnerability
Open

chore(deps): Update module github.com/apache/thrift to v0.23.0 [SECURITY] (release-3.7.x)#21778
renovate-sh-app[bot] wants to merge 1 commit intorelease-3.7.xfrom
deps-update/release-3.7.x-go-github.com-apache-thrift-vulnerability

Conversation

@renovate-sh-app
Copy link
Copy Markdown
Contributor

@renovate-sh-app renovate-sh-app Bot commented May 6, 2026

This PR contains the following updates:

Package Change Age Confidence
github.com/apache/thrift v0.22.0v0.23.0 age confidence

Apache Thrift TFramedTransport Go language implementation has an Integer Overflow or Wraparound vulnerability

CVE-2026-41602 / GHSA-wf45-q9ch-q8gh

More information

Details

Integer Overflow or Wraparound vulnerability in Apache Thrift TFramedTransport Go language implementation

This issue affects Apache Thrift: before 0.23.0.

Users are recommended to upgrade to version 0.23.0, which fixes the issue.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Apache Thrift TFramedTransport Go language implementation has an Integer Overflow or Wraparound vulnerability

BIT-thrift-2026-41602 / CVE-2026-41602 / GHSA-wf45-q9ch-q8gh

More information

Details

Integer Overflow or Wraparound vulnerability in Apache Thrift TFramedTransport Go language implementation

This issue affects Apache Thrift: before 0.23.0.

Users are recommended to upgrade to version 0.23.0, which fixes the issue.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

apache/thrift (github.com/apache/thrift)

v0.23.0: Version 0.23.0

Compare Source

Please head over to the official release download source:
http://thrift.apache.org/download

The assets listed below are added by Github based on the release tag and they will therefore not match the checkums published on the Thrift project website.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

Need help?

You can ask for more help in the following Slack channel: #proj-renovate-self-hosted. In that channel you can also find ADR and FAQ docs in the Resources section.

…ITY]

| datasource | package                  | from    | to      |
| ---------- | ------------------------ | ------- | ------- |
| go         | github.com/apache/thrift | v0.22.0 | v0.23.0 |


Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: int32 multiplication overflow bypasses protocol size check
    • Replaced overflowing int32 size multiplications with int64-based validation that checks the element count before applying minimum serialized element size.

Create PR

Or push these changes by commenting:

@cursor push 99a134916a
Preview (99a134916a)
diff --git a/vendor/github.com/apache/thrift/lib/go/thrift/binary_protocol.go b/vendor/github.com/apache/thrift/lib/go/thrift/binary_protocol.go
--- a/vendor/github.com/apache/thrift/lib/go/thrift/binary_protocol.go
+++ b/vendor/github.com/apache/thrift/lib/go/thrift/binary_protocol.go
@@ -356,8 +356,7 @@
 		return
 	}
 	minElemSize := p.getMinSerializedSize(kType) + p.getMinSerializedSize(vType)
-	totalMinSize := size32 * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(int64(size32), minElemSize, p.cfg)
 	if err != nil {
 		return
 	}
@@ -382,8 +381,7 @@
 		return
 	}
 	minElemSize := p.getMinSerializedSize(elemType)
-	totalMinSize := size32 * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(int64(size32), minElemSize, p.cfg)
 	if err != nil {
 		return
 	}
@@ -409,8 +407,7 @@
 		return
 	}
 	minElemSize := p.getMinSerializedSize(elemType)
-	totalMinSize := size32 * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(int64(size32), minElemSize, p.cfg)
 	if err != nil {
 		return
 	}

diff --git a/vendor/github.com/apache/thrift/lib/go/thrift/compact_protocol.go b/vendor/github.com/apache/thrift/lib/go/thrift/compact_protocol.go
--- a/vendor/github.com/apache/thrift/lib/go/thrift/compact_protocol.go
+++ b/vendor/github.com/apache/thrift/lib/go/thrift/compact_protocol.go
@@ -499,8 +499,7 @@
 	valueType, _ = p.getTType(tCompactType(keyAndValueType & 0xf))
 
 	minElemSize := p.getMinSerializedSize(keyType) + p.getMinSerializedSize(valueType)
-	totalMinSize := size32 * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(int64(size32), minElemSize, p.cfg)
 	if err != nil {
 		return
 	}
@@ -534,8 +533,7 @@
 	}
 
 	minElemSize := p.getMinSerializedSize(elemType)
-	totalMinSize := int32(size) * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(int64(size), minElemSize, p.cfg)
 	if err != nil {
 		return
 	}

diff --git a/vendor/github.com/apache/thrift/lib/go/thrift/configuration.go b/vendor/github.com/apache/thrift/lib/go/thrift/configuration.go
--- a/vendor/github.com/apache/thrift/lib/go/thrift/configuration.go
+++ b/vendor/github.com/apache/thrift/lib/go/thrift/configuration.go
@@ -317,13 +317,24 @@
 }
 
 func checkSizeForProtocol(size int32, cfg *TConfiguration) error {
+	return checkSizeForProtocolInt64(int64(size), cfg)
+}
+
+func checkSizeForProtocolMinSerializedSize(size int64, minSerializedSize int32, cfg *TConfiguration) error {
+	if err := checkSizeForProtocolInt64(size, cfg); err != nil {
+		return err
+	}
+	return checkSizeForProtocolInt64(size*int64(minSerializedSize), cfg)
+}
+
+func checkSizeForProtocolInt64(size int64, cfg *TConfiguration) error {
 	if size < 0 {
 		return NewTProtocolExceptionWithType(
 			NEGATIVE_SIZE,
 			fmt.Errorf("negative size: %d", size),
 		)
 	}
-	if size > cfg.GetMaxMessageSize() {
+	if size > int64(cfg.GetMaxMessageSize()) {
 		return NewTProtocolExceptionWithType(
 			SIZE_LIMIT,
 			fmt.Errorf("size exceeded max allowed: %d", size),

diff --git a/vendor/github.com/apache/thrift/lib/go/thrift/json_protocol.go b/vendor/github.com/apache/thrift/lib/go/thrift/json_protocol.go
--- a/vendor/github.com/apache/thrift/lib/go/thrift/json_protocol.go
+++ b/vendor/github.com/apache/thrift/lib/go/thrift/json_protocol.go
@@ -317,8 +317,7 @@
 	size = int(iSize)
 
 	minElemSize := p.getMinSerializedSize(keyType) + p.getMinSerializedSize(valueType)
-	totalMinSize := int32(iSize) * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(iSize, minElemSize, p.cfg)
 	if err != nil {
 		return keyType, valueType, 0, err
 	}
@@ -498,8 +497,7 @@
 	size = int(nSize)
 
 	minElemSize := p.getMinSerializedSize(elemType)
-	totalMinSize := int32(nSize) * minElemSize
-	err = checkSizeForProtocol(totalMinSize, p.cfg)
+	err = checkSizeForProtocolMinSerializedSize(nSize, minElemSize, p.cfg)
 	if err != nil {
 		return elemType, 0, err
 	}

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit a8a3a60. Configure here.

err = checkSizeForProtocol(size32, p.cfg)
minElemSize := p.getMinSerializedSize(kType) + p.getMinSerializedSize(vType)
totalMinSize := size32 * minElemSize
err = checkSizeForProtocol(totalMinSize, p.cfg)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

int32 multiplication overflow bypasses protocol size check

Medium Severity

The totalMinSize := size32 * minElemSize computation uses int32 * int32 arithmetic, which silently wraps on overflow in Go. A crafted size32 value can cause the product to wrap to a small non-negative int32, bypassing checkSizeForProtocol. For example, with map key/value types both DOUBLE (minElemSize = 16), an attacker-supplied size32 of 268435456 produces totalMinSize of 0 (since 268435456 × 16 = 2³², wrapping to 0). The old code directly checked size32 against maxMessageSize and would have rejected this value. Using int64 for the multiplication would prevent the wraparound.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a8a3a60. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants