default --block-private-networks for agent-driven examples (SSRF defense)#13
Open
staylor wants to merge 1 commit into
Open
default --block-private-networks for agent-driven examples (SSRF defense)#13staylor wants to merge 1 commit into
staylor wants to merge 1 commit into
Conversation
6d402a8 to
81f359a
Compare
Adds a new Security section to SKILL.md and turns --block-private-networks on by default in every canonical command across MCP, CLI, and CDP. The flag already exists in the Lightpanda binary — this is a docs/defaults change, not a feature. Threat model ============ Lightpanda executes page JavaScript. A skill marketed for agent integrations (Claude Code, Openclaw, others — per the README) is going to feed it URLs that originate outside the agent's control: search-result links, redirects, page-internal fetch calls, embedded iframe srcs. Any of those can resolve to localhost, RFC1918 ranges, or cloud-metadata endpoints (169.254.169.254 etc.). This is plain old SSRF — the only novelty is the agent context, which makes it more likely the user didn't manually vet the URL. --block-private-networks is the kernel-level IP filter Lightpanda already provides for exactly this case: it inspects post-DNS destination IPs and rejects anything in private ranges, regardless of what triggered the request (page JS, redirect chain, subresource). Changes ======= - New 'Security: block private networks for agent-driven use' section between Install and 'When to Use What', explaining the threat model. - Flag added to: claude mcp add, MCP JSON args, lead + 3 follow-up CLI fetch examples, canonical lightpanda serve command. - --block-private-networks + --block-cidrs documented in CLI fetch options list with brief descriptions and a back-link to Security. - --block-private-networks documented in CDP serve options list. - One-paragraph callout under canonical serve command explaining CDP has the same SSRF surface as MCP/CLI flows. - scripts/install.sh: final 'Run with:' echo updated to match the new canonical command. Users with legitimate need to hit private hosts (own dev server, staging behind VPN, intranet docs) just drop the flag — explicit guidance for when that's appropriate is included throughout.
81f359a to
64acb0d
Compare
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.
What & why
Adds a new
Securitysection toSKILL.mdand turns--block-private-networkson by default in every canonical command across MCP, CLI, and CDP. The flag already exists in the Lightpanda binary — this is a docs/defaults change, not a feature.The threat model
Lightpanda executes page JavaScript. A skill specifically marketed for agent integrations (Claude Code, Openclaw, others — per the README) is going to feed it URLs that originate outside the agent's control: search-result links, redirects, page-internal
fetchcalls, embedded<iframe>srcs. Any of those can resolve to:localhost(services running on the dev/CI machine driving the agent)10.0.0.0/8,172.16.0.0/12,192.168.0.0/16)169.254.169.254(AWS IMDS, GCP metadata server),100.64.0.0/10A malicious page can issue arbitrary requests to those addresses via JS-driven
fetch/XMLHttpRequest, redirects, image srcs, etc., harvesting AWS instance credentials or pivoting into private networks. This is plain old SSRF — the only novelty is the agent context, which makes it more likely the user didn't manually vet the URL.--block-private-networksis the kernel-level IP filter Lightpanda already provides for exactly this case: it inspects post-DNS-resolution destination IPs and rejects anything in private ranges, regardless of what triggered the request (page JS, redirect chain, subresource).Changes
169.254.169.254) and the recommendation.claude mcp addinvocation, MCP JSON configargs, lead CLIfetchexample, all three follow-up CLI examples, and the canonicallightpanda servecommand.--block-private-networksand--block-cidrsdocumented in the CLI fetch options list with brief descriptions and a back-link to the Security section.--block-private-networksdocumented in the CDP serve options list.servecommand explaining that CDP has the same SSRF surface as the MCP/CLI flows, with explicit guidance on when it's safe to drop the flag (driving the browser at private hosts you control: your own dev server, staging behind a VPN, etc.).scripts/install.sh: the finalRun with:echo updated to match the new canonical command.Tradeoff: when users want to hit private hosts
The flag is a runtime toggle, not a build option, so users with legitimate need (scraping their own internal dev server, staging behind a VPN, intranet documentation) just drop the flag and the docs explicitly call out where that's appropriate.
--block-cidrs 10.0.0.0/8,-10.0.0.42/32is also documented as a fine-grained escape hatch (block all of 10/8 except for one specific allowed host — the-prefix on a CIDR means "exempt from blocking", verified against the binary's own help).Stack
Independent of #11 (install.sh fixes) and #12 (docs corrections); all three branch off
maindirectly and can be reviewed/merged in any order.If you'd prefer this PR to only add the Security section without changing the canonical commands' defaults, happy to scope it down. The defaults are the most opinionated part — the section + flag documentation in the options lists are pure additions and uncontroversial.