cfsolve 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +8 -3
  4. data/UPSTREAM.md +8 -2
  5. data/lib/cfsolve/profiles/chrome-157-macos/answers.json +4777 -0
  6. data/lib/cfsolve/profiles/chrome-157-macos.json +613 -0
  7. data/lib/cfsolve/version.rb +2 -2
  8. data/lib/cfsolve.rb +1 -1
  9. data/vendor/cfsolve/README.md +53 -5
  10. data/vendor/cfsolve/examples/turnstile_smoke.rs +58 -0
  11. data/vendor/cfsolve/profiles/chrome-157-macos/answers.json +4777 -0
  12. data/vendor/cfsolve/profiles/chrome-157-macos.json +613 -0
  13. data/vendor/cfsolve/src/embedding_page/extra_params.rs +110 -7
  14. data/vendor/cfsolve/src/embedding_page/page.rs +41 -1
  15. data/vendor/cfsolve/src/session/initial.rs +7 -6
  16. data/vendor/cfsolve/src/session/probes.rs +1 -0
  17. data/vendor/cfsolve/src/stage2/analysis/analyze.rs +33 -4
  18. data/vendor/cfsolve/src/stage2/analysis/discovery.rs +13 -2
  19. data/vendor/cfsolve/src/stage2/benchmark.rs +59 -18
  20. data/vendor/cfsolve/src/stage2/call_stack.rs +169 -36
  21. data/vendor/cfsolve/src/stage2/fixtures/encoded_benchmark_worker.js +1 -0
  22. data/vendor/cfsolve/src/stage2/probes/dates.rs +44 -0
  23. data/vendor/cfsolve/src/stage2/probes/parent_info_array.rs +326 -0
  24. data/vendor/cfsolve/src/stage2/probes/stack.rs +117 -4
  25. data/vendor/cfsolve/src/stage2/probes/websocket_echo.rs +80 -2
  26. data/vendor/cfsolve/src/stage2/probes.rs +1 -0
  27. data/vendor/cfsolve/src/stage2/reference.rs +5 -0
  28. data/vendor/cfsolve/src/stage2/registry.rs +8 -2
  29. data/vendor/cfsolve/src/stage2/replay.rs +34 -3
  30. data/vendor/cfsolve/src/stage2/stylesheets.rs +35 -0
  31. data/vendor/cfsolve/src/stage2/value_labels.rs +185 -0
  32. data/vendor/cfsolve/src/stage2/vocabulary.rs +111 -6
  33. data/vendor/cfsolve/src/stage2.rs +1 -0
  34. data/vendor/cfsolve/src/vm/disassemble.rs +68 -4
  35. data/vendor/cfsolve/src/vm/encoded_names.rs +635 -0
  36. data/vendor/cfsolve/src/vm/extract.rs +246 -43
  37. data/vendor/cfsolve/src/vm/fixtures/free_functions/README.md +9 -0
  38. data/vendor/cfsolve/src/vm/fixtures/free_functions/machine.js +7438 -0
  39. data/vendor/cfsolve/src/vm/fixtures/free_functions/program.base64 +1 -0
  40. data/vendor/cfsolve/src/vm/interpret/access.rs +8 -2
  41. data/vendor/cfsolve/src/vm/interpret/intrinsic.rs +39 -1
  42. data/vendor/cfsolve/src/vm/interpret/pattern.rs +33 -4
  43. data/vendor/cfsolve/src/vm/interpret/register_helpers.rs +14 -6
  44. data/vendor/cfsolve/src/vm/interpret/run.rs +4 -0
  45. data/vendor/cfsolve/src/vm/machine.rs +63 -5
  46. data/vendor/cfsolve/src/vm/output.rs +6 -1
  47. data/vendor/cfsolve/src/vm/registers.rs +35 -21
  48. data/vendor/cfsolve/src/vm/session.rs +6 -3
  49. data/vendor/cfsolve/src/vm.rs +1 -0
  50. metadata +13 -1
@@ -10,8 +10,10 @@ fetch or the HTML of the page.
10
10
 
11
11
  ## Browser profiles
12
12
 
13
- cfsolve impersonates a specific browser, described by a profile file. One is
14
- included: `profiles/safari-26-ios.json` (Safari on iPhone).
13
+ cfsolve impersonates a specific browser, described by a profile file. This private
14
+ fork includes `profiles/chrome-157-macos.json`, captured and verified against
15
+ Hellenic Heritage on November 12, 2026. The older `profiles/safari-26-ios.json`
16
+ is retained, but its measurements do not pass the current Hellenic challenge.
15
17
 
16
18
  Each profile references recorded responses to the challenge's browser checks,
17
19
  stored as JSON in a directory. Keep each profile with its directory when you
@@ -21,6 +23,52 @@ set to the address of a running `capture-proxy`, which records the decoded
21
23
  payloads sent to Cloudflare. Currently only Safari and Chrome(ium) profile
22
24
  types are supported.
23
25
 
26
+ ### November 2026 compatibility fix
27
+
28
+ Cloudflare build `7c7fee70a876` moved its VM runner and register helpers out of the
29
+ interpreter class, introduced per-probe string decoders and a positional parent-page
30
+ message, and changed fingerprint result formats. The fork recovers those structures,
31
+ translates randomized font and permission labels, and refreshes page-dependent
32
+ results. Captured VM and worker fixtures cover the parser changes.
33
+
34
+ Use the updated engine **and** the Chrome 157 profile together. The previous Chrome
35
+ 156 measurements still fail even after the VM can execute the new challenge. A
36
+ prebuilt Ruby gem must be rebuilt against this fork; changing only its profile does
37
+ not replace its embedded native engine.
38
+
39
+ This repeatable check exercises the public library API, uses a fresh challenge on
40
+ every attempt, enforces the application's 30-second timeout, and prints only token
41
+ lengths and timings:
42
+
43
+ ```sh
44
+ cargo run --release --locked --example turnstile_smoke -- \
45
+ profiles/chrome-157-macos.json https://tickets.hh.gr/en/sign-in \
46
+ 0x4AAAAAACzgjQig4CtRf0fT 10
47
+ ```
48
+
49
+ The private repository's CI runs this check on Linux alongside tests and Clippy.
50
+ Successful solves verify token issuance; they do not sign in to a Hellenic account
51
+ or deploy the engine to Dashboard. Browser profiles may need recapture when
52
+ Cloudflare changes the probes again.
53
+
54
+ ### Audit decisions
55
+
56
+ The compatibility fix keeps both VM calling conventions, but resolves the VM class
57
+ and its register accessors from the installed runner. Unrelated `run` methods no
58
+ longer influence discovery. Captured decoders and property names are only folded
59
+ when their lexical binding is immutable; an unknown reassignment prevents folding.
60
+
61
+ Serialized JSON results use the same label translation as ordinary probe records.
62
+ The solver no longer guesses how to convert an old profile's permission-result
63
+ schema into the current schema. Use the freshly captured Chrome profile above;
64
+ profiles describe observed browser results, not a compatibility layer between
65
+ different challenge formats.
66
+
67
+ The audit also removed the one-off `inspect_initial` and `check_profile_names`
68
+ investigation examples. Keep `turnstile_smoke` for repeatable public API validation.
69
+ The replay session's parent-page data is internal and comes from the same typed
70
+ page signals as the loader message, so the two cannot be supplied independently.
71
+
24
72
  ## Building
25
73
 
26
74
  You need the Rust version pinned in `rust-toolchain.toml`, plus CMake, a C/C++
@@ -34,7 +82,7 @@ cargo build --release --bin challenge
34
82
 
35
83
  ```sh
36
84
  ./target/release/challenge --page 'https://example.com/login' /tmp/solve \
37
- --solve --fingerprint profiles/safari-26-ios.json
85
+ --solve --fingerprint profiles/chrome-157-macos.json
38
86
  ```
39
87
 
40
88
  On success it prints the token (or `cf_clearance=...`) and sends progress
@@ -48,7 +96,7 @@ it fails on a challenge page.
48
96
 
49
97
  ```sh
50
98
  ./target/release/challenge --page 'https://example.com/login' /tmp/solve \
51
- --solve --fingerprint profiles/safari-26-ios.json \
99
+ --solve --fingerprint profiles/chrome-157-macos.json \
52
100
  --sitekey 'SITEKEY' --action 'login' --cdata 'CUSTOM_DATA'
53
101
  ```
54
102
 
@@ -90,7 +138,7 @@ use cfsolve::{Browser, Options, PageSource, Turnstile};
90
138
 
91
139
  #[tokio::main]
92
140
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
93
- let browser = Browser::read("/path/to/cfsolve/profiles/safari-26-ios.json")?;
141
+ let browser = Browser::read("/path/to/cfsolve/profiles/chrome-157-macos.json")?;
94
142
  let options = Options::default();
95
143
 
96
144
  let turnstile = Turnstile {
@@ -0,0 +1,58 @@
1
+ //! Repeat fresh widget solves without printing or saving tokens.
2
+ //! Usage: turnstile_smoke <profile.json> <page-url> <sitekey> [attempts]
3
+
4
+ use std::{
5
+ env,
6
+ time::{Duration, Instant},
7
+ };
8
+
9
+ use anyhow::{Context, Result, ensure};
10
+ use cfsolve::{Browser, Options, PageSource, Turnstile, Widget};
11
+
12
+ #[tokio::main]
13
+ async fn main() -> Result<()> {
14
+ let mut arguments = env::args().skip(1);
15
+ let profile = arguments.next().context("supply a profile")?;
16
+ let url: cfsolve::Url = arguments.next().context("supply the page URL")?.parse()?;
17
+ let sitekey = arguments.next().context("supply the sitekey")?;
18
+ let attempts: usize = arguments.next().map_or(Ok(10), |value| value.parse())?;
19
+ ensure!(
20
+ (1..=100).contains(&attempts),
21
+ "attempts must be between 1 and 100"
22
+ );
23
+ let browser = Browser::read(&profile)?;
24
+ let started = Instant::now();
25
+ for attempt in 1..=attempts {
26
+ let tick = Instant::now();
27
+ let widget = Turnstile {
28
+ url: url.clone(),
29
+ page: PageSource::Navigate,
30
+ widget: Some(Widget {
31
+ sitekey: sitekey.clone(),
32
+ action: None,
33
+ cdata: None,
34
+ }),
35
+ };
36
+ let token = tokio::time::timeout(
37
+ Duration::from_secs(30),
38
+ browser.solve_turnstile(widget, &Options::default()),
39
+ )
40
+ .await
41
+ .with_context(|| format!("attempt {attempt} exceeded 30 seconds"))?
42
+ .with_context(|| format!("attempt {attempt} failed"))?;
43
+ ensure!(
44
+ !token.is_empty(),
45
+ "attempt {attempt} returned an empty token"
46
+ );
47
+ println!(
48
+ "PASS {attempt}/{attempts}: {}-byte token, {:.2}s",
49
+ token.len(),
50
+ tick.elapsed().as_secs_f64()
51
+ );
52
+ }
53
+ println!(
54
+ "{attempts}/{attempts} fresh solves passed in {:.2}s",
55
+ started.elapsed().as_secs_f64()
56
+ );
57
+ Ok(())
58
+ }