Skip to content

Comply with W3C Baggage specification limits - #7880

Merged
pellared merged 23 commits into
open-telemetry:mainfrom
XSAM:w3c-baggage-compliance
Feb 28, 2026
Merged

pellared merged 23 commits into
open-telemetry:mainfrom
XSAM:w3c-baggage-compliance

Conversation

@XSAM

@XSAM XSAM commented Feb 6, 2026 •

Copy link
Copy Markdown
Member

Updates the baggage implementation to comply with https://www.w3.org/TR/baggage/#limits:

  • Changed maxMembers from 180 to 64 (the W3C compliance requirement)

    The resulting baggage-string contains 64 list-members or less.

  • Removed maxBytesPerMembers (4096) - this per-member limit was not part of the W3C spec

  • Added limit checking in extractMultiBaggage for multiple baggage headers:

    • Checks combined byte size across all headers (max 8192 bytes)
    • Checks combined member count across all headers (max 64 members)

This PR uses non-deterministic truncation when handling baggage limits.

@codecov

codecov Bot commented Feb 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.78049% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.7%. Comparing base (7078987) to head (ee28d7a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
propagation/baggage.go 88.8% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7880   +/-   ##
=====================================
  Coverage   81.7%   81.7%           
=====================================
  Files        304     304           
  Lines      23287   23331   +44     
=====================================
+ Hits       19037   19077   +40     
- Misses      3863    3866    +3     
- Partials     387     388    +1     
Files with missing lines Coverage Δ
baggage/baggage.go 99.4% <100.0%> (+<0.1%) ⬆️
internal/errorhandler/errorhandler.go 100.0% <100.0%> (ø)
internal/global/state.go 100.0% <100.0%> (ø)
propagation/baggage.go 95.0% <88.8%> (-5.0%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@XSAM
XSAM marked this pull request as ready for review February 6, 2026 02:05
@MrAlias

MrAlias commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor
  • Drops all baggage if limits are exceeded per W3C spec

    If a platform cannot propagate all baggage, it MUST NOT propagate any partial list-members"

I don't think dropping all baggage is the correct interpretation of this requirement. We cannot propagate any "partial list-members", but it doesn't mean we cannot propagate complete list-members. Infact, the specification specifically states:

If either of the above conditions is not met, a platform MAY drop list-members until both conditions are met. The selection of which list-members to drop and their order is unspecified and left to the implementer.

While dropping all may indeed be a valid "selection" of list-members, I think we can do better and just take the first, or last n list-members the fit within the limits. Right?

@XSAM

XSAM commented Feb 7, 2026

Copy link
Copy Markdown
Member Author

While dropping all may indeed be a valid "selection" of list-members, I think we can do better and just take the first, or last n list-members the fit within the limits. Right?

Yeah. And, this will need to refactor baggage.Parse.

https://github.com/XSAM/opentelemetry-go/blob/0b29d8f4d883f334ce68981e269d34354ca494e1/baggage/baggage.go#L472

@MrAlias MrAlias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall this looks good. It addresses the critical security issue, looks W3C specification compliant, and is well tested. The error handling of Parse can be improved, and the issue in extractMultiBaggage, where it silently drops headers, needs to be fixed.

Comment thread propagation/baggage.go Resolved
Comment thread propagation/baggage.go Resolved
Comment thread baggage/baggage.go Resolved
Comment thread baggage/baggage.go Resolved
Comment thread propagation/baggage.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates OpenTelemetry Go baggage parsing and propagation to enforce W3C Baggage size/member limits (64 members, 8192 bytes) and adjusts tests/changelog accordingly.

Changes:

  • Reduce max baggage members to 64 and remove the per-member byte limit.
  • Apply byte/member limit enforcement while parsing baggage strings and when extracting from multiple baggage headers.
  • Add/adjust unit tests and document the change in the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
propagation/baggage.go Adds combined multi-header limit handling for member count and total bytes.
propagation/baggage_test.go Adds helper generators and new multi-header limit/behavior test cases.
baggage/baggage.go Updates constants and changes Parse behavior to truncate to W3C limits instead of erroring.
baggage/baggage_test.go Updates tests for new limit behavior and removed per-member limit.
CHANGELOG.md Notes W3C baggage limit compliance changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread propagation/baggage.go Resolved
Comment thread propagation/baggage.go Resolved
Comment thread propagation/baggage_test.go Resolved
Comment thread baggage/baggage.go Resolved
Comment thread baggage/baggage.go Resolved
@dmathieu
dmathieu self-requested a review February 17, 2026 15:32
@XSAM
XSAM force-pushed the w3c-baggage-compliance branch from 8858ccc to 1b59ccf Compare February 19, 2026 02:12
kubernetes-prow Bot pushed a commit to kubernetes-csi/csi-driver-smb that referenced this pull request Aug 27, 2026
Updates OpenTelemetry-Go and its companion modules from v1.43.0 to v1.44.0
to address CVE-2026-41178 (GHSA-5wrp-cwcj-q835), a denial-of-service
vulnerability in the baggage module.

OpenTelemetry-Go versions 1.41.0 and 1.43.0 removed raw-length rejection
in baggage.Parse, allowing arbitrarily large/invalid baggage headers to
exhaust resources during parsing. Version 1.44.0 restores the raw-length
check.

Updates:
- go.opentelemetry.io/otel: v1.43.0 → v1.44.0
- go.opentelemetry.io/otel/metric: v1.43.0 → v1.44.0
- go.opentelemetry.io/otel/sdk: v1.43.0 → v1.44.0
- go.opentelemetry.io/otel/trace: v1.43.0 → v1.44.0

Advisory: GHSA-5wrp-cwcj-q835
Upstream fix: open-telemetry/opentelemetry-go#7880
@glaubitz

glaubitz commented Sep 1, 2026

Copy link
Copy Markdown

It seems that some of the commits are required to fix version 1.43.0, but not all of them as trying to apply them gives a reject message about previously applied changes.

Can someone enlighten me which commit need to be applied to fix 1.43.0?

openshift-merge-bot Bot pushed a commit to openshift/csi-driver-smb that referenced this pull request Sep 1, 2026
…1.44.0 for CVE-2026-41178

Bump go.opentelemetry.io/otel and its lockstep modules (otel/metric,
otel/sdk, otel/trace) from v1.43.0 to v1.44.0 to remediate
CVE-2026-41178 (GHSA-5wrp-cwcj-q835): OpenTelemetry-Go Denial of Service
via oversized baggage headers.

otel v1.41.0 and v1.43.0 removed raw-length rejection, allowing
baggage.Parse to process arbitrarily large/invalid baggage headers and
log errors, enabling DoS via oversized inputs. v1.44.0 restores the
raw-length check (len(bStr) > maxBytesPerBaggageString) in baggage.Parse.

Upstream fix: open-telemetry/opentelemetry-go#7880
Advisory: GHSA-5wrp-cwcj-q835

vendor updated via: go get ...@v1.44.0 && go mod tidy && go mod vendor
redhat-chai-bot added a commit to redhat-chai-bot/openshift_cloud-provider-openstack that referenced this pull request Sep 1, 2026
…026-41178

Bumps go.opentelemetry.io/otel from v1.43.0 to v1.44.0 to address
CVE-2026-41178 (GHSA-5wrp-cwcj-q835), a moderate (CVSS 5.3) denial-of-service
vulnerability in baggage header parsing. The go.opentelemetry.io/otel/baggage
and go.opentelemetry.io/otel/propagation packages (both part of the otel
module, and vendored and used by this repository) processed arbitrarily
large/invalid baggage headers after an upfront raw-length check was removed
upstream. v1.44.0 restores the raw-length rejection in baggage.Parse.

The sibling modules go.opentelemetry.io/otel/metric,
go.opentelemetry.io/otel/sdk, and go.opentelemetry.io/otel/trace are bumped
to v1.44.0 as well to keep the OpenTelemetry modules aligned with the core
otel module. The Go directive is unchanged (go 1.26.0); v1.44.0 is
compatible with the release-5.0 toolchain, so no Go upgrade or sustaining
fork is required.

Upstream advisory: GHSA-5wrp-cwcj-q835
Upstream fix: open-telemetry/opentelemetry-go#7880

Related: OCPBUGS-108037

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 4.22.0-0.nightly-2026-09-03-092843

kdudka added a commit to RedHatProductSecurity/aegis-ai that referenced this pull request Sep 7, 2026
<https://github.com/open-telemetry/opentelemetry-go/> was added to
allowed GitHub prefixes but we only allow GitHub security advisories
to be fetched.

<open-telemetry/opentelemetry-go#7880> is
rejected according to the policy but we need to cached this outcome
for evals to stay independent on external data.

Fixes: commit c390f66
Related: https://redhat.atlassian.net/browse/AEGIS-495
Related: https://redhat.atlassian.net/browse/AEGIS-490
kdudka added a commit to RedHatProductSecurity/aegis-ai that referenced this pull request Sep 8, 2026
<https://github.com/open-telemetry/opentelemetry-go/> was added to
allowed GitHub prefixes but we only allow GitHub security advisories
to be fetched.

<open-telemetry/opentelemetry-go#7880> is
rejected according to the policy but we need to cached this outcome
for evals to stay independent on external data.

Fixes: commit c390f66
Related: https://redhat.atlassian.net/browse/AEGIS-495
Related: https://redhat.atlassian.net/browse/AEGIS-490
kdudka added a commit to RedHatProductSecurity/aegis-ai that referenced this pull request Sep 8, 2026
<https://github.com/open-telemetry/opentelemetry-go/> was added to
allowed GitHub prefixes but we only allow GitHub security advisories
to be fetched.

<open-telemetry/opentelemetry-go#7880> is
rejected according to the policy but we need to cached this outcome
for evals to stay independent on external data.

Fixes: commit c390f66
Related: https://redhat.atlassian.net/browse/AEGIS-495
Related: https://redhat.atlassian.net/browse/AEGIS-490
kdudka added a commit to RedHatProductSecurity/aegis-ai that referenced this pull request Sep 8, 2026
<https://github.com/open-telemetry/opentelemetry-go/> was added to
allowed GitHub prefixes but we only allow GitHub security advisories
to be fetched.

<open-telemetry/opentelemetry-go#7880> is
rejected according to the policy but we need to cached this outcome
for evals to stay independent on external data.

Fixes: commit c390f66
Related: https://redhat.atlassian.net/browse/AEGIS-495
Related: https://redhat.atlassian.net/browse/AEGIS-498
@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 5.1.0-0.nightly-2026-09-11-134220

@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 5.1.0-0.nightly-2026-09-11-221906

@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 5.0.0-0.nightly-2026-09-12-234912

@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 4.22.0-0.nightly-2026-09-15-174544

@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 5.1.0-0.nightly-2026-09-23-134227

@openshift-merge-robot

Copy link
Copy Markdown

Fix included in release 5.0.0-0.nightly-2026-10-07-134939

@open-telemetry open-telemetry locked as resolved and limited conversation to collaborators Oct 7, 2026
shiftstack-merge-bot-cloner Bot pushed a commit to shiftstack/cloud-provider-openstack that referenced this pull request Oct 14, 2026
…026-41178

Bumps go.opentelemetry.io/otel from v1.43.0 to v1.44.0 to address
CVE-2026-41178 (GHSA-5wrp-cwcj-q835), a moderate (CVSS 5.3) denial-of-service
vulnerability in baggage header parsing. The go.opentelemetry.io/otel/baggage
and go.opentelemetry.io/otel/propagation packages (both part of the otel
module, and vendored and used by this repository) processed arbitrarily
large/invalid baggage headers after an upfront raw-length check was removed
upstream. v1.44.0 restores the raw-length rejection in baggage.Parse.

The sibling modules go.opentelemetry.io/otel/metric,
go.opentelemetry.io/otel/sdk, and go.opentelemetry.io/otel/trace are bumped
to v1.44.0 as well to keep the OpenTelemetry modules aligned with the core
otel module. The Go directive is unchanged (go 1.26.0); v1.44.0 is
compatible with the release-5.0 toolchain, so no Go upgrade or sustaining
fork is required.

Upstream advisory: GHSA-5wrp-cwcj-q835
Upstream fix: open-telemetry/opentelemetry-go#7880

Related: OCPBUGS-108037

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants