Skip to content

[TT-18822] Classic Allow-List bypass via unstripped path evaluation and parameterized paths - #8869

Open
MaciekMis wants to merge 4 commits into
TT-18034-oas-allow-list-bypass-via-unstripped-path-evaluation-and-parameterized-pathsfrom
TT-18822-classic-allow-list-bypass-via-unstripped-path-evaluation-and-parameterized-paths
Open

MaciekMis wants to merge 4 commits into
TT-18034-oas-allow-list-bypass-via-unstripped-path-evaluation-and-parameterized-pathsfrom
TT-18822-classic-allow-list-bypass-via-unstripped-path-evaluation-and-parameterized-paths

Conversation

@MaciekMis

@MaciekMis MaciekMis commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

…d upstream

Description

Related Issue

Motivation and Context

How This Has Been Tested

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring or add test (improvements in base code or adds test coverage to functionality)

Checklist

  • I ensured that the documentation is up to date
  • I explained why this PR updates go.mod in detail with reasoning why it's required
  • I would like a code coverage CI quality gate exception and have explained why

Ticket Details

TT-18822
Status In Dev
Summary Classic Allow-List bypass via unstripped path evaluation and parameterized paths

Generated at: 2026-11-02 14:32:13

@sentinelone-cnapp-eu1

Copy link
Copy Markdown

SentinelOne CNS Hardcoded Secret Detector
✅ Congratulations, your code is safe

SentinelOne CNS is a cloud-agnostic, agentless CSPM & CWPP solution that continuously detects and prevents vulnerabilities that have the highest probability of being exploited in Azure, AWS, Google Cloud, and Kubernetes.

@probelabs

probelabs Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Powered by Visor from Probelabs

Last updated: 2026-11-02T14:32:51.961Z | Triggered by: pr_opened | Commit: 3dd1903

💡 TIP: You can chat with Visor using /visor ask <your question>

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🎯 Recommended Merge Targets

Based on JIRA ticket TT-18822: Classic Allow-List bypass via unstripped path evaluation and parameterized paths

Fix Version: Tyk 5.17.0

⚠️ Warning: Expected release branches not found in repository

Required:

  • master - No matching release branches found. Fix will be included in future releases.

Fix Version: Tyk 5.13.6

Required:

  • release-5.13 - Minor version branch for 5.13.x patches - required for creating Tyk 5.13.6
  • master - Main development branch - ensures fix is in all future releases

📋 Workflow

  1. Merge this PR to master first

  2. Cherry-pick to release branches by commenting on the merged PR:

    • /release to release-5.13
  3. Automated backport - The bot will automatically create backport PRs to the specified release branches

@probelabs

probelabs Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor
\n\n \n\n \n\n

Powered by Visor from Probelabs

Last updated: 2026-11-02T14:32:53.329Z | Triggered by: pr_opened | Commit: 3dd1903

💡 TIP: You can chat with Visor using /visor ask <your question>

@CLAassistant

CLAassistant commented Nov 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lghiur

lghiur commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how allow-list entries match, and it breaks one common config style on upgrade.

Example: listen path /employees, strip_listen_path: true. The upstream receives the request path without /employees.

Before: an entry matched if the full request path or the stripped path matched. The request was approved on one path and sent upstream as another:

Entry Request Result Upstream receives
/employees/static GET /employees/static 200 /static
/employees/{id} GET /employees/admin 200 /admin (any path is reachable)

After: an entry matches only the stripped path, which is the path the upstream receives:

Entry Request Result
/static GET /employees/static 200
/employees/static GET /employees/static 403
/employees/{id} GET /employees/admin 403

The bypass is closed, but every API that writes entries with the listen path (/employees/users instead of /users) breaks after the upgrade:

  • allow list: 403
  • ignored list: 401, because auth is no longer skipped
  • mocks: no longer returned, the request goes to the upstream
  • allowed_urls in prefix mode, on keys and policies: 403

The Dashboard writes relative paths, so this mostly hits definitions managed through the API, tyk-sync, Operator or scripts.

Why allow_unsafe_listen_path_matching doesn't solve it: the flag is gateway-wide. If one API needs the old behaviour, turning it on re-opens the bypass for every API on that gateway, Classic and OAS. Customers have to choose between broken APIs and an unpatched gateway.

Suggestion: keep the old behaviour by default, and let customers opt in to the strict matching with a flag such as disable_unsafe_listen_path_matching. Nothing breaks on upgrade, and customers switch once their entries are relative. We could then make strict matching the default in the next minor release, and log a warning when an entry starts with its own listen path, so customers know what to fix.

This trades a secure default for compatibility, so it needs to be validated with PM before we change it.

@lghiur

lghiur commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Two cases of the same bug are still open: the approved path and the proxied path can still differ.

Both happen on master too, so they are not regressions, but they break the ticket's acceptance criteria.

1. Version stripping removes one segment too many (AC1, AC2)

Example: listen path /employees, strip_listen_path: true, strip_versioning_data: true, allow list /admin.

Versioning Request Result Upstream receives
Header (x-api-version: v1) GET /employees/anything/admin 200 /anything/admin
URL (^v\d+$) GET /employees/v1/v2/admin 200 /v2/admin

matchesPath calls StripVersionPath, which drops the first segment whenever strip_versioning_data is on. With header versioning there is no version in the path. With URL versioning, VersionCheck has already removed it. The proxy removes nothing more, so the upstream gets a path no entry declares.

Suggestion: strip the version segment only for URL versioning, and not again after VersionCheck has removed it. The ticket also asks for StripVersionPath regression tests, which aren't in the PR. #8810 has the same matchesPath code, so OAS probably has this too. If we want to keep this PR small, let's open a linked High follow-up before release.

2. With strip_listen_path: false, two path forms still match (AC3)

Example: listen path /employees, strip_listen_path: false, allow list ^/employees/static$.

Request Result Upstream receives
GET /employees/employees/static 200 /employees/employees/static

The entry matches the stripped form (/employees/static), but the upstream gets the full path. AC3 says we check "the exact path that will be proxied upstream", and this doesn't.

Fixing this in code would break strip-off APIs with relative entries, which is what the Dashboard writes. So we either change the matching, or reword AC3 and document the limitation. Like the default question above, this should be decided with PM.

@shults
shults force-pushed the TT-18034-oas-allow-list-bypass-via-unstripped-path-evaluation-and-parameterized-paths branch 2 times, most recently from f6d4983 to 9bd56d2 Compare November 26, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants