Prevent smokescreen upstream connections to its local IPs#282
Merged
rishikej-stripe merged 3 commits intomasterfrom Jan 9, 2026
Merged
Prevent smokescreen upstream connections to its local IPs#282rishikej-stripe merged 3 commits intomasterfrom
rishikej-stripe merged 3 commits intomasterfrom
Conversation
Pull Request Test Coverage Report for Build 20851618744Details
💛 - Coveralls |
saurabhbhatia-stripe
requested changes
Jan 8, 2026
Contributor
saurabhbhatia-stripe
left a comment
There was a problem hiding this comment.
Overall LGTM, can we add some unit tests for the new lines added.
sohamsen-stripe
previously approved these changes
Jan 9, 2026
saurabhbhatia-stripe
approved these changes
Jan 9, 2026
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
This PR adds an additional check for the target IP to ensure the smokescreen proxy does not connect to itself if a client passes smokescreen's IP/localhost as the target address.
Motivation
Smokescreen does not prevent clients from issuing CONNECT requests that target Smokescreen's own listening address. If the ACL configuration permits connections to the proxy's IP (e.g., 127.0.0.1, localhost, its internal IP range or its external IP), a malicious client can establish a recursive connection loop. Each iteration of the loop creates a new nested tunnel, consuming file descriptors, memory, and goroutines, rapidly leading to resource exhaustion and Denial of Service (DoS).
Test plan
Tested locally. The PoC passes a burst of 10000 requests through 1000 concurrent workers to the smokescreen proxy.
Before
Client makes continuous recursive connections by keeping localhost as the target.
After
Smokescreen denies the request to any of its local IPs.