CVE-2022-23628: Incorrect Calculation in github.com/open-policy-agent/opa
6.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.52472%
CWE
Published
2/9/2022
Updated
5/20/2024
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/open-policy-agent/opa | go | >= 0.33.1, < 0.37.2 | 0.37.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The core vulnerability stems from the interaction between:
- Synthetic nodes created during optimization (without proper locations)
- groupIterable's location-based sorting in format.go
- Ast()'s default location assignment
The key fix in 932e4ff modified groupIterable to check for defaultLocationFile and avoid reordering when present. The vulnerable versions' groupIterable sorted elements by location row numbers, but synthetic nodes either lacked locations (pre-0.33.1) or had artificial ones (post-0.33.1 via Ast()), leading to unstable ordering. The Ast function's default location assignment (medium confidence) enabled the problematic sorting behavior when combined with groupIterable's logic.