DHI-j65i-hfj6-jzd3-ygps

Source
https://scout.docker.com/v/DHI-j65i-hfj6-jzd3-ygps
Import Source
https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json
JSON Data
https://api.osv.dev/v1/vulns/DHI-j65i-hfj6-jzd3-ygps
Upstream
  • GHSA-pf4h-74fx-87r6
Published
2026-11-19T02:33:49Z
Modified
2026-11-27T04:00:15Z
Summary
### Summary
Details

Summary

Incorrect number comparison in OPA can cause wrong policy decisions, including wrongful authorization.

Affected numbers have a decimal point followed only by zeros, and an integer part that ends in zero (100.0, 1000.00). OPA strips these trailing zeros before comparing, including the zeros in the integer part, so 100.0 is treated as equal to 1, 1000.00 to 1, and 20.0 to 2. The comparison goes wrong when the stripped value exactly matches the other operand. Numbers such as 105.0, 100.5 and 100 are not affected.

Details

Which numbers are affected

A number is affected if it has a decimal point followed only by zeros, and an integer part that ends in zero (100.0, 1000.00). Stripping 100.0, 1000.00, 20.0 and 30400.0 yields 1, 1, 2 and 304. Numbers whose integer part does not end in zero (105.0), whose decimal part contains a non-zero digit (100.5, 10.50), or that have no decimal point (100) are not affected.

The comparison is wrong only if the stripped value exactly matches the other operand: 100.0 is mistaken for 1, but not for 10 or 2. The comparison is symmetric, so the affected number may be on either side. It does not have to come from the attacker: a policy constant or data value such as 100.0 can be matched by an attacker-supplied input value of 1.

All comparison operators are affected, as is equality of arrays, objects and sets, and max/min built-in functions. Rule indexing hides the problem in some rules that compare against a literal (see below), but this must not be relied upon.

In v1.20.0 only numbers longer than 19 characters are affected, e.g. 100000000000000000000.0 == 1.

Examples

Versions v1.10.0 - v1.19.x.

Operators. Literals only, evaluated as queries. The affected operators:

Expression Expected Actual Correct Note
100.0 == 1 false true ❌ 100.0 is trimmed to 1. The values are treated as equal
100.0 != 1 true false ❌ 100.0 is trimmed to 1. The values are treated as equal
100.0 > 1 true false ❌ 100.0 is trimmed to 1. The values are treated as equal, so neither is greater
100.0 <= 1 false true ❌ 100.0 is trimmed to 1. The values are treated as equal, so <= holds
100.0 >= 1 true true ✅ Correct, but only because the values are treated as equal and >= accepts equality. 100.0 is still trimmed to 1
100.0 < 1 false false ✅ Correct, but only because the values are treated as equal. 100.0 is still trimmed to 1
[100.0] == [1], {100.0} == {1}, {"a": 100.0} == {"a": 1} false true ❌ 100.0 is trimmed to 1. Elements are compared with the same logic
max([100.0, 1]) 100.0 1 ❌ 100.0 is trimmed to 1. The values are treated as equal, so max keeps the later element
min([1, 100.0]) 1 100.0 ❌ 100.0 is trimmed to 1. The values are treated as equal, so min keeps the later element
max([1, 100.0]) 100.0 100.0 ✅ Correct only because the larger value comes last. 100.0 is still trimmed to 1
max([1, 100.0]) == 1 false true ❌ max returns the correct 100.0; the following == is what fails
100.0 == 10 false false ✅ The stripped value 1 does not match 10
100.1 == 1 false false ✅ 100.1 ends in a non-zero digit, so nothing is trimmed
123.0 == 1 false false ✅ The integer part of 123.0 ends in a non-zero digit, so only the .0 is trimmed

Where the number comes from. The affected number may originate from input (typically attacker-controlled), the policy, or data, and may be either operand of the comparison, or both:

Trailing zeros in Policy expression Input / data Expected Actual Correct Note
input input.x == data.limit data.limit = 1, input.x = 100.0 false true ❌ 100.0 is trimmed to 1, which equals data.limit
input max([input.x, 1]) input.x = 100.0 100.0 1 ❌ The values are treated as equal, so max keeps the later element
policy input.x >= 100.0 input.x = 1 false true ❌ 100.0 is trimmed to 1, which equals input.x, so >= holds
policy input.x >= 100.0 input.x = 2 false false ✅ The stripped value 1 does not match 2, so the numeric comparison is used
data input.x == data.limit data.limit = 100.0, input.x = 1 false true ❌ 100.0 is trimmed to 1
input and data input.x == data.limit data.limit = 1000.0, input.x = 10.0 false true ❌ 1000.0 and 10.0 are both trimmed to 1

Effect of rule indexing

OPA indexes rules that compare a base document reference with a literal, such as input.x == 1. When a rule is resolved by the index, the rule body is skipped for non-matching input and the faulty comparison is never evaluated. This reduces the exposed surface, but it is an optimization and not a mitigation: whether it applies depends on the shape of the rule, and small changes to a policy can turn it off.

Policy Input / data Expected Actual Correct Note
Query: input.x == 1 input.x = 100.0 false true ❌ Queries are not indexed
Rule: allow if input.x == 1 input.x = 100.0 false false ✅ Resolved by the index; the body is not evaluated
Rule: allow if { input.x > 0; input.x == 1 } input.x = 100.0 false false ✅ The equality is the last expression on input.x, so it is indexed
Rule: allow if { input.x == 1; input.x > 0 } input.x = 100.0 false true ❌ A later expression that passes input.x to a function or operator, or assigns it, makes the index accept any value for input.x; and the equality is then also evaluated
Rule: allow if input.x == data.limit input.x = 100.0, data.limit = 1 false true ❌ Only comparisons with literals are indexed

Comparisons that are not == against a literal (ordering operators, !=, data or computed values, collections, max/min) are not indexed and are affected as described above.

Workarounds

If upgrading is not possible:

  • Reject or rewrite numbers in input whose decimal part consists only of zeros (100.0, 1000.00) before they reach OPA. Numbers with a non-zero decimal digit (100.5) need no handling.
  • Avoid writing integral values with a zero-only decimal part in data and policy (100, not 100.0). This does not protect against input values written that way.

Proof of concept

Run with the released opa v1.10.0 binary. Each command prints the wrong result on v1.10.0 – v1.19.x and the correct result on v1.20.1 and later.

1. Literals only

$ opa eval -fpretty '100.0 == 1'
true            # expected: false

$ opa eval -fpretty '100.0 <= 1'
true            # expected: false

$ opa eval -fpretty 'max([100.0, 1])'
1               # expected: 100.0

2. Equality against data: wrongful authorization

policy.rego:

package authz

default allow := false

allow if input.role_id == data.admin_role_id

data.json: {"admin_role_id": 1}

$ echo '{"role_id": 10.0}' | opa eval -fpretty -d policy.rego -d data.json -I data.authz.allow
true            # expected: false

$ echo '{"role_id": 10}' | opa eval -fpretty -d policy.rego -d data.json -I data.authz.allow
false           # correct: an integer is not affected

The attacker supplies 10.0, which is stripped to 1 and matches admin_role_id.

Impact

Who is impacted: anyone running an affected version of OPA (as a server, library or through the Go SDK, including embedded use such as Envoy, Kubernetes admission control or custom authorization services) whose policies compare a number that an attacker can influence with another number. The attacker does not need to control the trailing zeros on both sides: a policy constant or data value such as 100.0 can be matched by a plain integer 1 in the input, and an input value such as 100.0 can match a policy constant 1. Policies that only compare integers written without a decimal point, or that never compare caller-influenced numbers, are not affected.

Consequences: OPA returns an incorrect evaluation result (integrity of the decision). Depending on the policy this is an authorization bypass, a wrongful denial, or other wrongful policy result. There is no direct effect on OPA's own confidentiality, integrity or availability; the impact falls on the relying application, whose protected data and operations are exposed by a wrong allow.

References

Affected packages

Docker Hardened Images:Alpine:3.23
opa-dev

Package

Name
opa-dev
Purl
pkg:apk/dhi/opa-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips-dev

Package

Name
opa-fips-dev
Purl
pkg:apk/dhi/opa-fips-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips

Package

Name
opa-fips
Purl
pkg:apk/dhi/opa-fips

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa

Package

Name
opa
Purl
pkg:apk/dhi/opa

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
Docker Hardened Images:Alpine:3.24
opa-dev

Package

Name
opa-dev
Purl
pkg:apk/dhi/opa-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips-dev

Package

Name
opa-fips-dev
Purl
pkg:apk/dhi/opa-fips-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips

Package

Name
opa-fips
Purl
pkg:apk/dhi/opa-fips

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa

Package

Name
opa
Purl
pkg:apk/dhi/opa

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-r0

Affected versions

1.*
1.18.2-r0
1.19.0-r0
1.19.0-r1
1.19.1-r0
1.19.1-r1
1.20.0-r0
1.20.1-r0
1.20.1-r1
1.20.2-r0
1.20.2-r1
1.21.0-r0
1.21.1-r0
1.21.1-r1
1.21.1-r2
1.21.2-r0
1.21.3-r0
1.21.3-r1
1.21.4-r0
1.21.4-r1
1.22.0-r0
1.22.1-r0
1.22.2-r0
1.22.2-r1
1.22.3-r0
1.22.3-r1
1.22.4-r0
1.22.4-r1
1.23.0-r0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
Docker Hardened Images:Debian:13
opa-dev

Package

Name
opa-dev
Purl
pkg:deb/dhi/opa-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-0

Affected versions

1.*
1.18.2-0
1.19.0-0
1.19.0-1
1.19.1-0
1.19.1-1
1.20.0-0
1.20.1-0
1.20.1-1
1.20.2-0
1.20.2-1
1.21.0-0
1.21.1-0
1.21.1-1
1.21.1-2
1.21.2-0
1.21.3-0
1.21.3-1
1.21.4-0
1.21.4-1
1.22.0-0
1.22.1-0
1.22.2-0
1.22.2-1
1.22.3-0
1.22.3-1
1.22.4-0
1.22.4-1
1.23.0-0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips-dev

Package

Name
opa-fips-dev
Purl
pkg:deb/dhi/opa-fips-dev

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-0

Affected versions

1.*
1.18.2-0
1.19.0-0
1.19.0-1
1.19.1-0
1.19.1-1
1.20.0-0
1.20.1-0
1.20.1-1
1.20.2-0
1.20.2-1
1.21.0-0
1.21.1-0
1.21.1-1
1.21.1-2
1.21.2-0
1.21.3-0
1.21.3-1
1.21.4-0
1.21.4-1
1.22.0-0
1.22.1-0
1.22.2-0
1.22.2-1
1.22.3-0
1.22.3-1
1.22.4-0
1.22.4-1
1.23.0-0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa-fips

Package

Name
opa-fips
Purl
pkg:deb/dhi/opa-fips

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-0

Affected versions

1.*
1.18.2-0
1.19.0-0
1.19.0-1
1.19.1-0
1.19.1-1
1.20.0-0
1.20.1-0
1.20.1-1
1.20.2-0
1.20.2-1
1.21.0-0
1.21.1-0
1.21.1-1
1.21.1-2
1.21.2-0
1.21.3-0
1.21.3-1
1.21.4-0
1.21.4-1
1.22.0-0
1.22.1-0
1.22.2-0
1.22.2-1
1.22.3-0
1.22.3-1
1.22.4-0
1.22.4-1
1.23.0-0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"
opa

Package

Name
opa
Purl
pkg:deb/dhi/opa

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1.18.2-0

Affected versions

1.*
1.18.2-0
1.19.0-0
1.19.0-1
1.19.1-0
1.19.1-1
1.20.0-0
1.20.1-0
1.20.1-1
1.20.2-0
1.20.2-1
1.21.0-0
1.21.1-0
1.21.1-1
1.21.1-2
1.21.2-0
1.21.3-0
1.21.3-1
1.21.4-0
1.21.4-1
1.22.0-0
1.22.1-0
1.22.2-0
1.22.2-1
1.22.3-0
1.22.3-1
1.22.4-0
1.22.4-1
1.23.0-0

Database specific

owner_kind
"HSP"
source
"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-j65i-hfj6-jzd3-ygps.json"