chris124567/cfsolve
Security & PrivacySolve Cloudflare Turnstile widgets and challenge pages from Rust, without a headless browser.
cfsolve is a Rust library and CLI that targets Cloudflare's Turnstile widgets and interstitial challenge pages, returning either a Turnstile token or a cf_clearance cookie. It works by replaying a recorded browser identity rather than driving a real browser, so the useful output is a credential you then reuse yourself.
What it produces and how
For a Turnstile widget, you supply the page URL, the sitekey, and optionally the page HTML; you get back a token. For a challenge page, it fetches (or accepts) the page and returns a Clearance containing the cf_clearance cookie, all cookies for the page, and the protected page HTML. A combined solve call handles both cases when you don't know which one a URL serves.
The distinguishing mechanism is browser impersonation through a profile file. The bundled profiles/safari-26-ios.json describes Safari on iPhone and references directories of recorded responses to Cloudflare's browser checks. The README says only Safari and Chrome(ium) profile types are supported, and that producing new profile data takes manual effort, though a capture proxy can record payloads from a real browser. This matters: the include profile is a starting point, not a universal identity.
Using it
The CLI takes a page URL, an output directory for all requests/responses (must be empty or nonexistent), and --fingerprint with a profile. Several widgets on one page can be selected by sitekey, with action and cData when the site sets them; --blank-page covers the sitekey-only case. A proxy can be set with HTTP, HTTPS, SOCKS5 or SOCKS5H URLs.
The library is a path dependency, with default-features = false to build only the solver, and a [patch] section copied into your top-level Cargo.toml for vendored btls-sys, wreq and http2. Load a Browser once and share it; concurrent operations get their own connections and cookies. Building requires the pinned Rust toolchain, CMake, a C/C++ compiler, libclang and Git.
Conditions that decide whether it fits
- The returned
cf_clearancecookie must be sent from the same IP address and user agent as the profile, or Cloudflare rejects it. Any proxy change invalidates reuse. - Errors are typed and partly actionable:
Rejected,ChallengedandNetworkare marked retryable, whileBlocked,NotChallenged,ConfigandUnsupportedare not.Unsupportedcovers a new challenge build or a page with no widget, which is the expected shape of breakage. - The author's own comment on the HN thread reports a user for whom European proxies failed but US proxies worked, suspects regional challenge versions, and says a fix is planned; the author notes Cloudflare changes constantly. Treat this as an ongoing maintenance race rather than a fixed capability.
- The license is MIT, but patched dependencies under
vendor/keep their own licenses.
HotRepo's take
The project reached 177 total stars and #27 on the NEW-REPOSITORY board in a single observation on 2026-10-31, and the HN thread drew 121 points and 31 comments. The comment threads include skepticism about scale: one commenter argues single bypasses are easier than sustained operation because Cloudflare detects behavioral patterns across its network. That is opinion, not a measured result, but it aligns with the author's own regional-failure report.
Written by AI from the project's README, updated October 31, 2026. The project's own docs are the source of truth.