Skip to content

[GHSA-8qqm-fp2q-v734] Skipper: Incomplete fix for CVE-2026-50197: an oversized body can bypass OPA deny-on-presence Rego policies - #9161

Closed
deepakravisankar wants to merge 4 commits into
github:deepakravisankar/advisory-improvement-9161from
deepakravisankar:deepakravisankar-GHSA-8qqm-fp2q-v734
Closed

[GHSA-8qqm-fp2q-v734] Skipper: Incomplete fix for CVE-2026-50197: an oversized body can bypass OPA deny-on-presence Rego policies#9161
deepakravisankar wants to merge 4 commits into
github:deepakravisankar/advisory-improvement-9161from
deepakravisankar:deepakravisankar-GHSA-8qqm-fp2q-v734

Conversation

@deepakravisankar

Copy link
Copy Markdown

Updates

  • CWEs

Comments
This advisory currently has no CWE assigned ("cwe_ids": []). Proposing four, primary first, based on the advisory description and the pre-/post-fix source.

CWE-636 (Not Failing Securely, 'Failing Open') — primary. The advisory's own wording is that deny-on-presence Rego policies "fail OPEN": on the oversized-body path OPA receives an empty parsed_body, so the authorization decision falls back to the more permissive outcome while the full payload still reaches the upstream.

CWE-863 (Incorrect Authorization). The authorization check does execute — it just evaluates an empty document and therefore decides incorrectly. This fits better than CWE-285, since the check is performed rather than skipped.

CWE-130 (Improper Handling of Length Parameter Inconsistency). Root cause is the handling of a declared Content-Length inconsistent with the bytes actually made available to the policy engine. In v0.27.25, filters/openpolicyagent/openpolicyagent.go sets expectedSize := req.ContentLength, special-cases only expectedSize < 0 (chunked / HTTP/2), then gates body extraction on expectedSize <= opa.maxBodyBytes; a declared Content-Length greater than maxBodyBytes skips extraction entirely and yields a nil body.

CWE-754 (Improper Check for Unusual or Exceptional Conditions). The incomplete CVE-2026-50197 fix reasoned only about the ContentLength == -1 case; the oversized-declared-length branch was never handled, and the accompanying regression test covered only small bodies.

Fix confirmation: v0.27.26 removes the expectedSize <= maxBodyBytes gate so oversized bodies are read and truncated to maxBodyBytes, letting the policy compare bytes-read against the declared Content-Length.

Affected range left unchanged: the pre-fix v0.26.9 gate was req.ContentLength <= opa.maxBodyBytes, so an oversized declared Content-Length fell through there too. The bypass predates the CVE-2026-50197 fix, so "introduced": "0" is correct.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 07:17

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

Adds CWE classifications to the Skipper oversized-body authorization bypass advisory.

Changes:

  • Adds four proposed CWE mappings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread advisories/github-reviewed/2026/07/GHSA-8qqm-fp2q-v734/GHSA-8qqm-fp2q-v734.json Outdated
@github-actions
github-actions Bot changed the base branch from main to deepakravisankar/advisory-improvement-9161 August 19, 2026 07:28
@deepakravisankar

Copy link
Copy Markdown
Author

Note for reviewers: this supersedes #9160 (now closed), which was the original improvement for this advisory.

#9160 carried two problems that are fixed here:

Resulting set: CWE-636 (primary, fail-open) · CWE-863 (incorrect authorization) · CWE-754 (unhandled oversized branch in the incomplete CVE-2026-50197 fix).

Affected range intentionally unchanged: the pre-fix v0.26.9 gate was req.ContentLength <= opa.maxBodyBytes, so an oversized declared Content-Length fell through there too. The bypass predates the CVE-2026-50197 fix, so "introduced": "0" is correct.

@deepakravisankar

Copy link
Copy Markdown
Author

Created #9162 for the same

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.

2 participants