chore(deps): update module github.com/open-policy-agent/opa to v1 [security] #928
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.70.0->v1.4.0GitHub Vulnerability Alerts
CVE-2025-46569
Impact
When run as a server, OPA exposes an HTTP Data API for reading and writing documents. Requesting a virtual document through the Data API entails policy evaluation, where a Rego query containing a single data document reference is constructed from the requested path. This query is then used for policy evaluation.
A HTTP request path can be crafted in a way that injects Rego code into the constructed query. The evaluation result cannot be made to return any other data than what is generated by the requested path, but this path can be misdirected, and the injected Rego code can be crafted to make the query succeed or fail; opening up for oracle attacks or, given the right circumstances, erroneous policy decision results. Furthermore, the injected code can be crafted to be computationally expensive, resulting in a Denial Of Service (DoS) attack.
Users are only impacted if all of the following apply:
input.pathattribute when deciding if the request should be allowed.or, if all of the following apply:
Note: With no Authorization Policy configured for restricting API access (the default configuration), the RESTful Data API provides access for managing Rego policies; and the RESTful Query API facilitates advanced queries. Full access to these APIs provides both simpler, and broader access than what the security issue describes here can facilitate. As such, OPA servers exposed to a network are not considered affected by the attack described here if they are knowingly not restricting access through an Authorization Policy.
Patches
Fixed in OPA v1.4.0.
Workarounds
Don’t publicly expose OPA’s RESTful APIs
Unless necessary for production reasons, network access to OPA’s RESTful APIs should be limited to
localhostand/or trusted networks.Since OPA v1.0, unless otherwise configured, the server listener defaults to
localhost.Enable Authentication to Only Allow Access to Trusted Clients
A configured authentication scheme is a requirement when OPA is exposed in an untrusted environment. While requiring authentication alone doesn’t mitigate this attack, it effectively reduces the scope from untrusted clients to trusted clients.
Perform Path Validation Using OPA’s Authorization Policy Functionality
OPA can be configured to use an Authorization Policy to validate all incoming requests.
By authoring the Authorization Policy to only accept paths corresponding to expected Rego package references, this attack can be fully mitigated.
The HTTP path in a Data API request is of the format
/v1/data/{path:.+}(/v0/data/{path:.+}, for the v0 Data API), wheredata/{path:.+}directly corresponds to a reference to a virtual document, and a prefix of{path:.+}corresponds to a Regopackagedeclaration.E.g. the HTTP path
v1/data/do/re/micorresponds to the data referencedata.do.re.mi, wheredo.reis the package andmiis the rule in the following Rego module:Unless otherwise configured, OPA will use the rule at
data.system.authz.allowas Authorization Policy. Authorization is enabled by starting OPA with the--authorization=basicflag, and the Authorization policy must be made available to the OPA runtime either through a bundle (via the--bundleflag or through discovery) or as an individual module via the command-line.A trivial Authorization Policy example:
Note: configuring an Authorization Policy in OPA isn't the only way to protect against malicious request paths. Path validation and sanitisation can also be performed by connecting clients and 3rd party intermediaries, such as API gateways, reverse proxies, etc.
Release Notes
open-policy-agent/opa (github.com/open-policy-agent/opa)
v1.4.0Compare Source
This release contains a security fix addressing CVE-2025-46569.
It also includes a mix of new features, bugfixes, and dependency updates.
Security Fix: CVE-2025-46569 - OPA server Data API HTTP path injection of Rego (GHSA-6m8w-jc87-6cr7)
A vulnerability in the OPA server's Data API allows an attacker to craft the HTTP path in a way that injects Rego code into the query that is evaluated.
The evaluation result cannot be made to return any other data than what is generated by the requested path, but this path can be misdirected, and the injected Rego code can be crafted to make the query succeed or fail; opening up for oracle attacks or, given the right circumstances, erroneous policy decision results.
Furthermore, the injected code can be crafted to be computationally expensive, resulting in a Denial Of Service (DoS) attack.
Users are only impacted if all of the following apply:
or, if all of the following apply:
Note: With no Authorization Policy configured for restricting API access (the default configuration), the RESTful Data API provides access for managing Rego policies; and the RESTful Query API facilitates advanced queries.
Full access to these APIs provides both simpler, and broader access than what the security issue describes here can facilitate.
As such, OPA servers exposed to a network are not considered affected by the attack described here if they are knowingly not restricting access through an Authorization Policy.
This issue affects all versions of OPA prior to 1.4.0.
See the Security Advisory for more details.
Reported by @GamrayW, @HyouKash, @AdrienIT, authored by @johanfylling
Runtime, Tooling, SDK
rego_v1feature to--v0-compatiblecapabilities (#7474) authored by @johanfyllingTopdown and Rego
internal/gqlparser/astto Position fields (#7509) authored by @robmyersrobmyersPartialRun()(#7490) authored by @srenatusDocs, Website, Ecosystem
/docs/edge/path (#7529) authored by @charlieegan3Miscellaneous
v1.3.0Compare Source
This release contains a mix of features, bugfixes, and dependency updates.
New Buffer Option for Decision Logs (#5724)
A new, optional, buffering mechanism has been added to decision logging.
The default buffer is designed around making precise memory footprint guarantees, which can produce lock contention at high loads, negatively impacting query performance.
The new event-based buffer is designed to reduce lock contention and improve performance at high loads, but sacrifices the memory footprint guarantees of the default buffer.
The new event-based buffer is enabled by setting the
decision_logs.reporting.buffer_typeconfiguration option toevent.For more details, see the decision log plugin README.
Reported by @mjungsbluth, authored by @sspaink
OpenTelemetry: HTTP Support and Expanded Batch Span Configuration (#7412)
Distributed tracing through OpenTelemetry has been extended to support HTTP collectors (enabled by setting the
distributed_tracing.typeconfiguration option tohttp).Additionally, configuration has been expanded with fine-grained batch span processor options.
Authored and reported by @sqyang94
Runtime, Tooling, SDK
Docs, Website, Ecosystem
kindusage instruction in Envoy tutorial (#7465) authored by @joostholslagMiscellaneous
v1.2.0Compare Source
This release contains a mix of features, performance improvements, and bugfixes.
Parameterized Rego Tests (#2176)
Rego tests now support parameterization, allowing a single test rule to include multiple, hierarchical, named test cases.
This feature is useful for data-driven testing, where a single test rule can be used for multiple test cases with different inputs and expected outputs.
See the documentation for more information.
Authored by @johanfylling, reported by @anderseknert
Performance Improvements
opa fmt3x faster formatting (#7341) authored by @anderseknertTopdown and Rego
Runtime, Tooling, SDK
BuildAnnotationSettoastv0 (#7347) authored by @anderseknert[]byte(#7379) authored by @dennygursky--v0-compatibleisn't respected for custom bundles (#7338) authored by @johanfyllingopa test --bench(#7205) authored by @anderseknertopa execoutput (#7373) authored by @anderseknertDocs, Website, Ecosystem
v1 import(#7391) authored by @charlieegan3--v1-compatiblementions outside the v1 upgrade guide and v0 compatibility docs (#7337) authored by @johanfyllingMiscellaneous
make test-shorttask (#7364) (authored by @anderseknert)TestIntraQueryCache_ClientErrorandTestInterQueryCache_ClientError(#7280) authored by @Juneezeev1.1.0Compare Source
This release contains a mix of features, performance improvements, and bugfixes.
Performance Improvements
opa bench(#7291) authored by @anderseknertio.jwttoken verification built-ins (#7274) authored by @johanfyllingTopdown and Rego
numbers.rangebuilt-in (#7269) authored by @anderseknertRuntime, Tooling, SDK
opa repl(#7301) authored by @anderseknert reported by @tsandall--v0-compatibleforopa evalpartial eval support modules (#7251) authored by @johanfyllinglinter-settingsconfiguration name (#7244) authored by @JuneezeeDocs, Website, Ecosystem
Miscellaneous
v1.0.1Compare Source
This is a bug fix release addressing the following issues:
Addressing
CVE-2024-45341andCVE-2024-45336vulnerabilities in the Go runtime.Fixing an issue where the rego-version for individual modules was lost during bundle deactivation (bundle lifecycle) if this version diverged from the active runtime rego-version.
This could cause reloading of v0 bundles to fail when OPA was not running with the
--v0-compatibleflag.v1.0.0Compare Source
We are excited to announce OPA 1.0, a milestone release consolidating an improved developer experience for the future of Policy as Code. The release makes new functionality designed to simplify policy writing and improve the language's consistency the default.
Changes to Rego in OPA 1.0
Below we highlight some key changes to the defaults in OPA 1.0:
iffor all rule definitions andcontainsfor multi-value rules is now mandatory, not just when using therego.v1import.every,in) are available without any imports.opa check --strict) are now the default. Duplicate imports and imports which shadow each other are no longer allowed.if you must continue to support v0 Rego.
Read more about the OPA 1.0 announcement here on our blog.
Following are other changes that are included in OPA 1.0.
Improvements to memory allocations
PRs #7172, #7190, #7193, #7165, #7168, #7191 & #7222 together improve the memory performance of OPA. Key strategies
include reusing pointers and optimizing array and object operations, minimizing intermediate object creation, and using
sync.Poolto manage memory-heavy operations. These changes cumulatively greatly reduced the number of allocations and improved
evaluation speed by 10-20%. Additional benchmarks highlighted significant memory and speed improvements in custom
function evaluation.
Authored by @anderseknert.
Wrap http.RoundTripper for SDK users
PR #7180 adds an
EvalHTTPRoundTripEvalOption and query-levelWithHTTPRoundTripoption.Both use a new function type which converts an
http.Transportconfigured by topdown to anhttp.RoundTripper.This supports use cases requiring the customization of the
http.sendbuilt in behavior.Authored by @evankanderson.
Improvements to scientific notation parsing in
units.parsePR #7147 extends the behaviour of
extractNumAndUnitto supportscientific notation values. This means values such as
1e3KBcan now be handled by this function.Authored by @berdanA.
Support customized buckets
bundle_loading_duration_nsmetricPR #7156 extends OPA’s Prometheus configuration to allow the
setting of user defined buckets for metrics. This aids when debugging the loading of slow bundles.
Authored by @jwu730-1.
Test suite performance improvements
PR #7126 updates tests to improve performance. Topdown and
storage/disk/tests now run around 50% and 75% faster respectively.
Authored by @philipaconrad.
OPA 1.0 Preparation
rego.v1andfuture.keywordsimports for v1 by @johanfylling in #7224--rego-v1cmd flag to--v0-v1by @johanfylling in #7225Topdown and Rego
topdown/cacheby @evankanderson in #7188to_numbernow rejects "Inf", "Infinity" and "NaN" values by @sikehish in #7203Runtime, Tooling, SDK
opa build: provide an option to preserve print statements for the "wasm" target (#7194) by @me-viper in #7195opa eval: Return error if illegal arguments passed with--unknownsflag by @kd-labs in #7149Docs, Website, Ecosystem
Dependency Updates
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.