GHSA-RMX9-2PP3-XHCR
Vulnerability from github – Published: 2026-04-21 16:25 – Updated: 2026-04-21 16:25Summary
The Trusted Resources verification system matches a resource source string (refSource.URI) against spec.resources[].pattern using Go's regexp.MatchString. In Go, regexp.MatchString reports a match if the pattern matches anywhere in the input string. As a result, common unanchored patterns—including examples found in Tekton documentation—can be bypassed by attacker-controlled source strings that contain the trusted pattern as a substring. This may cause an unintended policy match and alter which verification mode or keys are applied.
Affected Component
- Repository: https://github.com/tektoncd/pipeline
- Commit:
0133513db03dadb3cb08301d6b0330badcb63830 - Call site:
pkg/trustedresources/verify.go:118–137(getMatchedPolicies)
Impact
An attacker can craft a Trusted Resources source string that embeds a trusted substring and still matches an unanchored VerificationPolicy spec.resources[].pattern, even if the policy is intended to constrain matches to a specific trusted source. This occurs because regexp.MatchString succeeds on substring matches. For example, a pattern such as https://github.com/tektoncd/catalog.git would match an attacker-controlled source like https://evil.com/?x=https://github.com/tektoncd/catalog.git.
Affected: Deployments using Trusted Resources verification with unanchored VerificationPolicy patterns, where an attacker can influence the refSource.URI value used for policy matching.
Not affected: Deployments that anchor all patterns (^...$) or otherwise enforce full-string matching; deployments where attackers cannot influence refSource.URI.
Reproduction
Canonical (Demonstrates Vulnerability)
unzip -q -o poc.zip -d /tmp/poc-tekton-regex-001
cd /tmp/poc-tekton-regex-001/poc-F-TEKTON-REGEX-001
bash ./run.sh canonical | tee /tmp/tekton-regex-001-canonical.log
- Expected (secure): Capability not reached; canonical does not emit vulnerability markers.
- Actual (vulnerable): Capability reached; canonical emits vulnerability markers.
- Canonical markers (mandatory):
[CALLSITE_HIT]+[PROOF_MARKER]
Negative Control
bash ./run.sh control | tee /tmp/tekton-regex-001-control.log
- Expected: Capability not reached under the same harness; control emits the control marker and does not emit vulnerability markers.
- Control markers (mandatory):
[CALLSITE_HIT]+[NC_MARKER]
Verification
grep -n '\[PROOF_MARKER\]' /tmp/tekton-regex-001-canonical.log \
&& grep -n '\[NC_MARKER\]' /tmp/tekton-regex-001-control.log \
&& ! grep -n '\[PROOF_MARKER\]' /tmp/tekton-regex-001-control.log
Suggested Fix
It is recommended to make matching safe-by-default by requiring full-string matches, or by validating patterns and clearly documenting substring semantics. Possible approaches include:
- Anchor patterns before matching — e.g., wrap
patternas^(?:pattern)$when not already anchored. - Introduce a separate field for exact match vs. regex match semantics.
- Document substring semantics explicitly and update all documentation examples to include anchors.
A fix is considered accepted when, under the same harness, the canonical test still hits [CALLSITE_HIT] but does not emit [PROOF_MARKER].
Workarounds
Anchor all VerificationPolicy resource patterns so they must match the full source string. For example:
pattern: "^https://github\\.com/tektoncd/catalog\\.git$"
Proof Bundle
- Bundle: poc.zip
- Convention: The zip extracts under a single top-level folder (
poc-F-TEKTON-REGEX-001/) to avoid collisions. - Contains:
canonical.log,control.log,witness.txt - Extracted paths:
./poc/poc-F-TEKTON-REGEX-001/canonical.log,./poc/poc-F-TEKTON-REGEX-001/control.log,./poc/poc-F-TEKTON-REGEX-001/witness.txt - Integrity verification: Compare
shasum -a 256forcanonical.log,control.log,fix.patch, and test source againstwitness.txt.
Note: If a supported integration uses verified HTTPS app-links or universal links only, provide the supported tag or branch and retesting on that pin can be arranged.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/tektoncd/pipeline"
},
"ranges": [
{
"events": [
{
"introduced": "0.43.0"
},
{
"fixed": "1.11.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-25542"
],
"database_specific": {
"cwe_ids": [
"CWE-185"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-21T16:25:19Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe Trusted Resources verification system matches a resource source string (`refSource.URI`) against `spec.resources[].pattern` using Go\u0027s `regexp.MatchString`. In Go, `regexp.MatchString` reports a match if the pattern matches **anywhere** in the input string. As a result, common unanchored patterns\u2014including examples found in Tekton documentation\u2014can be bypassed by attacker-controlled source strings that contain the trusted pattern as a substring. This may cause an unintended policy match and alter which verification mode or keys are applied.\n\n## Affected Component\n\n- **Repository:** \u003chttps://github.com/tektoncd/pipeline\u003e\n- **Commit:** `0133513db03dadb3cb08301d6b0330badcb63830`\n- **Call site:** `pkg/trustedresources/verify.go:118\u2013137` (`getMatchedPolicies`)\n\n## Impact\n\nAn attacker can craft a Trusted Resources source string that embeds a trusted substring and still matches an unanchored `VerificationPolicy` `spec.resources[].pattern`, even if the policy is intended to constrain matches to a specific trusted source. This occurs because `regexp.MatchString` succeeds on substring matches. For example, a pattern such as `https://github.com/tektoncd/catalog.git` would match an attacker-controlled source like `https://evil.com/?x=https://github.com/tektoncd/catalog.git`.\n\n**Affected:** Deployments using Trusted Resources verification with unanchored `VerificationPolicy` patterns, where an attacker can influence the `refSource.URI` value used for policy matching.\n\n**Not affected:** Deployments that anchor all patterns (`^...$`) or otherwise enforce full-string matching; deployments where attackers cannot influence `refSource.URI`.\n\n## Reproduction\n\n### Canonical (Demonstrates Vulnerability)\n\n```bash\nunzip -q -o poc.zip -d /tmp/poc-tekton-regex-001\ncd /tmp/poc-tekton-regex-001/poc-F-TEKTON-REGEX-001\nbash ./run.sh canonical | tee /tmp/tekton-regex-001-canonical.log\n```\n\n- **Expected (secure):** Capability not reached; canonical does not emit vulnerability markers.\n- **Actual (vulnerable):** Capability reached; canonical emits vulnerability markers.\n- **Canonical markers (mandatory):** `[CALLSITE_HIT]` + `[PROOF_MARKER]`\n\n### Negative Control\n\n```bash\nbash ./run.sh control | tee /tmp/tekton-regex-001-control.log\n```\n\n- **Expected:** Capability not reached under the same harness; control emits the control marker and does not emit vulnerability markers.\n- **Control markers (mandatory):** `[CALLSITE_HIT]` + `[NC_MARKER]`\n\n### Verification\n\n```bash\ngrep -n \u0027\\[PROOF_MARKER\\]\u0027 /tmp/tekton-regex-001-canonical.log \\\n \u0026\u0026 grep -n \u0027\\[NC_MARKER\\]\u0027 /tmp/tekton-regex-001-control.log \\\n \u0026\u0026 ! grep -n \u0027\\[PROOF_MARKER\\]\u0027 /tmp/tekton-regex-001-control.log\n```\n\n## Suggested Fix\n\nIt is recommended to make matching safe-by-default by requiring full-string matches, or by validating patterns and clearly documenting substring semantics. Possible approaches include:\n\n1. **Anchor patterns before matching** \u2014 e.g., wrap `pattern` as `^(?:pattern)$` when not already anchored.\n2. **Introduce a separate field** for exact match vs. regex match semantics.\n3. **Document substring semantics explicitly** and update all documentation examples to include anchors.\n\nA fix is considered accepted when, under the same harness, the canonical test still hits `[CALLSITE_HIT]` but **does not** emit `[PROOF_MARKER]`.\n\n## Workarounds\n\nAnchor all `VerificationPolicy` resource patterns so they must match the full source string. For example:\n\n```yaml\npattern: \"^https://github\\\\.com/tektoncd/catalog\\\\.git$\"\n```\n\n## Proof Bundle\n\n- **Bundle:** [poc.zip](https://github.com/user-attachments/files/24833926/poc.zip)\n- **Convention:** The zip extracts under a single top-level folder (`poc-F-TEKTON-REGEX-001/`) to avoid collisions.\n- **Contains:** `canonical.log`, `control.log`, `witness.txt`\n- **Extracted paths:** `./poc/poc-F-TEKTON-REGEX-001/canonical.log`, `./poc/poc-F-TEKTON-REGEX-001/control.log`, `./poc/poc-F-TEKTON-REGEX-001/witness.txt`\n- **Integrity verification:** Compare `shasum -a 256` for `canonical.log`, `control.log`, `fix.patch`, and test source against `witness.txt`.\n\n\u003e **Note:** If a supported integration uses verified HTTPS app-links or universal links only, provide the supported tag or branch and retesting on that pin can be arranged.",
"id": "GHSA-rmx9-2pp3-xhcr",
"modified": "2026-04-21T16:25:19Z",
"published": "2026-04-21T16:25:19Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/tektoncd/pipeline/security/advisories/GHSA-rmx9-2pp3-xhcr"
},
{
"type": "WEB",
"url": "https://github.com/tektoncd/pipeline/commit/2c398711e6e9e232180508f0648425a8ea34dc9e"
},
{
"type": "PACKAGE",
"url": "https://github.com/tektoncd/pipeline"
},
{
"type": "WEB",
"url": "https://github.com/tektoncd/pipeline/releases/tag/v1.11.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Tekton Pipelines has VerificationPolicy regex pattern bypass via substring matching"
}
Sightings
| Author | Source | Type | Date |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.