Pay x402 gateways when an audit meets one - #231
Merged
Merged
Conversation
smartFetch's clearnet path — the fetch every audit reads the customer's site with — now goes through a paidFetch: with X402_PRIVATE_KEY set, a 402 carrying an x402 offer is signed with the shared crawler wallet, the pass is filed by origin and presented on every later request, so auditing a gated site reads the site rather than its sales page. Without the key it is the global fetch, unchanged. Capped at five dollars a payment; the key is read through a non-literal accessor because Next inlines process.env. Deliberately not wired: link-status probes and uptime pings. Both touch many third-party domains per run, and paying a dollar to learn a link's status would be waste. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSGS7Sy3QmEgTNZDg4eq7g
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
ThreatCrush Security Scan39 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 28 | LOW: 9
Snippets are redacted; ThreatCrush never prints matched credential material. |
ralyodio
added a commit
that referenced
this pull request
Sep 5, 2026
CodeQL flagged the paying fetch in #231 as server-side request forgery, and it was right about the shape if not the novelty: the audit fetches whatever URL a customer submits, and nothing checked where that resolved. A submitted http://169.254.169.254/ would have read the cloud metadata service from our server. The old fetch(url) in smartFetch had the same hole; the wrapper only made the flow visible. lib/net-guard.ts resolves the host and refuses any private, loopback, link-local, CGNAT or multicast answer — the same rules outreach's mailbox discovery applies — before the request, and again on the final URL after redirects. CRAWLPROOF_ALLOW_PRIVATE_TARGETS=1 turns it off for auditing a local server in development. Link-status probes and uptime pings remain on the plain fetch as before. Claude-Session: https://claude.ai/code/session_01NSGS7Sy3QmEgTNZDg4eq7g Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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.
Wires @profullstack/x402-client into smartFetch's clearnet path (the audit's page fetch). Env-gated on X402_PRIVATE_KEY (set on Railway), $5 cap, plain fetch when unset. Link-status probes and uptime pings deliberately stay on plain fetch. tsc clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NSGS7Sy3QmEgTNZDg4eq7g