CVE-2022-28946: Github.com/open policy agent/opa Out Of Bounds Memory Access Vulnerability
HIGHCVE-2022-28946 is a HIGH (CVSS 7.5) out of bounds memory access vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Github.com/open policy agent/opa libraries in the Go ecosystem. The issue involves out of bounds memory access in github.com/open-policy-agent/opa. Remediation is available by upgrading affected packages to version 0.40.0.
CVE-2022-28946 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-28946
To remediate this vulnerability, upgrade all affected Github.com/open policy agent/opa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/open-policy-agent/opa to 0.40.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/open-policy-agent/opa
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-28946, inspect your project dependencies for Github.com/open policy agent/opa:
inspect dependencies for github.com/open-policy-agent/opa
Analyze the terminal output to locate any version of Github.com/open policy agent/opa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.40.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Github.com/open policy agent/opa, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-28946 Affected Github.com/open policy agent/opa Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/open-policy-agent/opa
|
Go |
< 0.40.0
|
0.40.0
|
References
Frequently Asked Questions
What is CVE-2022-28946?
Which Github.com/open policy agent/opa versions are affected?
What version fixes CVE-2022-28946?
Is github.com/open-policy-agent/opa affected?
What is the CVSS score of CVE-2022-28946?
What CWE is associated with CVE-2022-28946?
How can I check Go dependencies for CVE-2022-28946?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-x7f3-62pm-9p38",
"modified" : "2022-05-31T23:27:52Z",
"published" : "2022-05-20T00:00:26Z",
"aliases" : [ "CVE-2022-28946" ],
"summary" : "Out of bounds memory access in github.com/open-policy-agent/opa",
"details" : "An issue in the component ast/parser.go of Open Policy Agent v0.39.0 causes the application to incorrectly interpret every expression, causing a Denial of Service (DoS) via triggering out-of-range memory access.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/open-policy-agent/opa"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.40.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-28946"
}, {
"type" : "WEB",
"url" : "https://github.com/open-policy-agent/opa/pull/4548"
}, {
"type" : "WEB",
"url" : "https://github.com/open-policy-agent/opa/commit/e9d3828db670cbe11129885f37f08cbf04935264"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/open-policy-agent/opa"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2022-0587"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-119" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-05-25T20:20:13Z",
"nvd_published_at" : "2022-05-19T19:15:00Z"
}
}