fix: anchor Klaviyo proxy endpoint allowlist to the full path shape - #11294
Draft
Michael Pineiro (michaelpineirocontentful) wants to merge 1 commit into
Conversation
The proxy's endpoint allowlist only checked the segment before the first slash, so a value like "template-universal-content/../lists" passed the check while the traversal segment let the request reach a Klaviyo endpoint that was never allowlisted. Replace the prefix check with a pattern anchored to the exact shape the app actually sends (an allowed endpoint, optionally followed by a single id segment), rejecting anything else outright.
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
Michael Pineiro (michaelpineirocontentful)
added this pull request to stack #11296
September 9, 2026 20:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The Klaviyo proxy function's endpoint allowlist only checked the path segment before the first slash. A value like
template-universal-content/../listspassed that check, and the traversal segment let the request reach a Klaviyo API endpoint that was never allowlisted.Solution
Context
Third in a small stack of hardening fixes to the Klaviyo app found during a routine security review. Verified the new pattern still matches every endpoint value the frontend currently sends (bare endpoint names and
endpoint/{id}), while rejecting traversal and encoded-traversal variants.Test plan
tsc --noEmitpassesbuild-functions) succeeds