Security model

Refuse by default

A scraper is a program that fetches URLs on behalf of somebody else, so the interesting failures are the ones it should never produce: a request to a private network, a request that ignores a robots rule, a page that floods the origin, or a UI that executes what it scraped. CrawlForge closes each of those paths in code, not in documentation.

SSRF guard

The guard never trusts the hostname. It resolves the name, then validates every returned address against the blocklist below — including the IPv4-mapped IPv6 forms, which is how a public name can smuggle a private address past a naive check.

Check order

  1. Scheme must be http or https
  2. Embedded credentials are rejected
  3. Blocked hostnames are rejected
  4. IP literals are validated against the CIDR blocklist
  5. DNS resolution, then every resolved address is re-validated
  6. The socket is pinned to the validated IP: the transport never resolves the hostname again
  7. Every 3xx redirect hop restarts the whole sequence

IPv4 blocklist

CIDR Class
0.0.0.0/8 unspecified
10.0.0.0/8 rfc1918-private
100.64.0.0/10 cgnat-carrier-grade-nat
127.0.0.0/8 loopback
169.254.0.0/16 link-local-cloud-metadata
172.16.0.0/12 rfc1918-private
192.0.0.0/24 ietf-protocol-assignments
192.0.2.0/24 test-net-1
192.88.99.0/24 6to4-relay-anycast
192.168.0.0/16 rfc1918-private
198.18.0.0/15 benchmarking
198.51.100.0/24 test-net-2
203.0.113.0/24 test-net-3
224.0.0.0/4 multicast
240.0.0.0/4 reserved-broadcast

IPv6 blocklist

CIDR Class
::/128 unspecified
::1/128 loopback
::/96 ipv4-compatible-deprecated
::ffff:0:0/96 ipv4-mapped-ipv6
::ffff:0:0:0/96 ipv4-translated
64:ff9b::/96 nat64
64:ff9b:1::/48 local-nat64
100::/64 discard-only
2001::/32 teredo
2001:10::/28 orchid
2001:20::/28 orchidv2
2001:db8::/32 documentation
2002::/16 6to4
fec0::/10 site-local-deprecated
fc00::/7 unique-local
fe80::/10 link-local
ff00::/8 multicast

Redirect hops

A redirect is a new request, so the whole sequence runs again for every hop. A public URL that answers with a redirect to 169.254.169.254 is refused at the hop, not after the request has already been sent.

DNS-rebinding defences

Validating an address is not enough: between the validation and the connection the name could be resolved again, and the second answer could point at a private network. CrawlForge closes that window by pinning the socket to the address it validated.

Layer Behaviour
HTTP transport The validated address is handed to the socket through a custom lookup callback, so the OS resolver is never consulted a second time.
TLS The certificate is still checked against the original hostname: the SNI is preserved and the Host header is set explicitly.
Proxy The environment proxy variables are ignored — a proxy would resolve the hostname outside of the SSRF Guard.
Chromium The initial host is pinned with --host-resolver-rules=MAP <host> <validated ip>.
Residual risk A Chromium sub-resource hosted on another domain is only validated, not pinned: it is checked before the request is allowed.

Robots policy

The robots policy is implemented as RFC 9309 specifies it, including the failure mode: an unreachable robots.txt allows the crawl rather than blocking it.

Rule Behaviour
Standard RFC 9309 — the Robots Exclusion Protocol.
Groups User-agent groups are matched case-insensitively.
Directives Allow, Disallow, Crawl-delay and Sitemap.
Longest match The most specific matching rule wins, Allow wins ties.
Wildcards * and $ wildcards are supported in path patterns.
Failure An unreachable robots.txt allows everything, as the RFC requires.

Rate limiter

The rate limiter is a token bucket per hostname. It is what keeps a crawl from turning into a denial of service against the origin.

Stage Behaviour
Bucket One token bucket per hostname, created lazily.
Refill 2 requests per second by default, configurable per run.
Burst 2 tokens, so a burst never exceeds the configured capacity.
Floor A minimum interval of 500 ms between two requests to a host.
Crawl-delay A robots.txt Crawl-delay raises the floor of the bucket.
Clock The clock is injected, so the pacing is deterministic in tests.

Local Workbench boundary

The Workbench is a development tool that renders pages you fetched yourself. It has no authentication, so its whole security model is the loopback interface plus the checks below.

Boundary Rule
Bind 127.0.0.1 only — the server refuses any other interface.
Host header Only 127.0.0.1:<port> and localhost:<port> are accepted.
Origin header A cross-origin POST is rejected with 403.
Authentication None — the Workbench never listens on a public interface.
Content Security Policy script-src 'self', style-src 'self', object-src 'none'.
DOM writes Every DOM update uses textContent, never markup injection.
Errors Failures are returned as clean JSON, never as a stack trace.

Workbench response headers

Header Value
Content-Security-Policy default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'
X-Content-Type-Options nosniff
X-Frame-Options DENY
Referrer-Policy no-referrer

Showcase response headers

Header Value
Content-Security-Policy default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'none'
X-Content-Type-Options nosniff
Referrer-Policy strict-origin-when-cross-origin
X-Frame-Options DENY
Permissions-Policy geolocation=(), microphone=(), camera=()