{"id":"GHSA-rr2c-p22p-6r9r","summary":"Istio: Ambient mode mTLS bypass via PeerAuthentication bug","details":"### Summary\n\nA boolean operator-precedence bug in `convertPeerAuthentication()` (`pilot/pkg/serviceregistry/ambient/authorization.go`) makes Istio ambient mode silently drop per-port STRICT mTLS enforcement. The mesh-level check is missing the \"workload-level policy is unset\" guard, so the port is wrongly treated as already covered by the mesh-wide STRICT policy.\n\n\n### Details\n\nA boolean operator-precedence error in `convertPeerAuthentication()`  ( `pilot/pkg/serviceregistry/ambient/authorization.go` ) causes Istio ambient mode to silently skip enforcement of a portLevelMtls  STRICT setting.\n\nWhen a workload-level `PeerAuthentication` has mode `PERMISSIVE` or `DISABLE`, it can also set `portLevelMtls` to `STRICT` on a specific port. If the namespace has no `STRICT` `PeerAuthentication` and the mesh-wide (root namespace) `PeerAuthentication` is `STRICT`, the port is wrongly treated as already enforced by the parent policy. The \"workload-level policy is unset\" guard applies only to the namespace-level check. The mesh-level check is evaluated without it.\n\nAs a result, the per-port `DENY` policy is not generated and not sent to ztunnel. The workload still references it by name, which leaves a dangling reference. ztunnel then accepts plaintext connections on a port the operator configured to require mTLS. Sidecar mode enforces `STRICT` correctly in the same configuration, so this is an ambient-only divergence. There is no error or warning.\n\nFixes are available in 1.31.4 and 1.30.8.\n\n### Workarounds\n\nUntil you can upgrade, use one of these:\n\n- Set the workload-level `PeerAuthentication` `mtls.mode` to `STRICT`, and use `portLevelMtls` with `PERMISSIVE` only for the ports that need plaintext.\n- Add a namespace-level `STRICT` `PeerAuthentication` in the affected namespace.\n\n### Proof of concept\n\n* Ambient mode. \n* The mesh-wide `PeerAuthentication` in `istio-system` is `STRICT`, and the namespace has no `PeerAuthentication`.\n\n```yaml\napiVersion: security.istio.io/v1\nkind: PeerAuthentication\nmetadata:\n  name: workload-port-strict\nspec:\n  selector:\n    matchLabels:\n      app: workload\n  mtls:\n    mode: PERMISSIVE\n  portLevelMtls:\n    8443:\n      mode: STRICT\n```\n\nSend plaintext from a non-mesh client to port 8443:\n\n```bash\ncurl -sv --max-time 5 http://workload:8443/\n```\n\n| Parent of STRICT | Result |\n|---|---|\n| Mesh-wide STRICT (bug) | HTTP 200, plaintext accepted |\n| Namespace-wide STRICT (control) | Connection reset, rejected |\n\nIn the bug case, ztunnel has no `converted_peer_authentication_workload-port-strict` policy, but the workload still references it by name.\n\n**Cause:** in `convertPeerAuthentication()`, `A || (B && C) || D` should be `A || (B && (C || D))`. The mesh-level check (D) skips the port without the \"workload-level unset\" guard (B).","aliases":["CVE-2026-145364"],"modified":"2026-12-05T18:47:40.252993188Z","published":"2026-12-04T22:07:09Z","database_specific":{"github_reviewed_at":"2026-12-04T22:07:09Z","nvd_published_at":null,"cwe_ids":["CWE-693","CWE-783"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/istio/istio/security/advisories/GHSA-rr2c-p22p-6r9r"},{"type":"WEB","url":"https://github.com/istio/istio/commit/03a427bc69a4621d2e6006c0f18bc873a6d23d3a"},{"type":"WEB","url":"https://github.com/istio/istio/commit/30de921835cb2e1ca5ae4538cccc7b4f2beeaa29"},{"type":"WEB","url":"https://github.com/istio/istio/commit/33369baf78eb3219f712fe48e8074f90d51f0202"},{"type":"WEB","url":"https://github.com/istio/istio/commit/7bc0eb20bc839d467968b426d73e42dd7addaba3"},{"type":"PACKAGE","url":"https://github.com/istio/istio"},{"type":"WEB","url":"https://github.com/istio/istio/releases/tag/1.30.8"},{"type":"WEB","url":"https://github.com/istio/istio/releases/tag/1.31.4"},{"type":"WEB","url":"https://github.com/istio/istio/releases/tag/1.32.0"}],"affected":[{"package":{"name":"istio.io/istio","ecosystem":"Go","purl":"pkg:golang/istio.io/istio"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-20260112152740-3af7534ca9a9"},{"fixed":"0.0.0-20261106211527-30de921835cb"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-rr2c-p22p-6r9r/GHSA-rr2c-p22p-6r9r.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"}]}