cad-editor/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 87232bba2c fix(expr-eval): bound eval_to_string against super-linear DoS
The recursion-depth guard fixes the parser stack overflow, but user input
actually flows through eval_to_string (command line, viewport, dynamic
input — synchronous on the UI thread). Its embedded-expression fallback
re-tokenises every (start, end) window, so cost is ≈O(n³): a few-KB paste
of non-evaluable text or deeply nested parens froze the app for seconds to
minutes even though eval_number fast-returns None in microseconds
(measured: "x"×3200 → 16 s, 4 KB of parens → 51 s).

Cap the fallback scan at MAX_EVAL_SCAN_LEN (256) — whole-string numbers
and expressions of any length still evaluate via the fast paths; only the
mixed free-text scan is bounded, returning long input unchanged. Clarify
that MAX_RECURSION counts parser frames (256 ≈ 41 nested parens, not 256
levels). Add regression tests: the 41/42 nesting boundary, unary-chain and
function-arg-nesting rejection, and an eval_to_string over-cap promptness
test (50k junk + 100k nested parens return instantly).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 22:41:02 +03:00
..
app fix(expr-eval): bound eval_to_string against super-linear DoS 2026-06-28 22:41:02 +03:00
entities fix(block-cache): address PR211 review follow-ups 2026-06-28 21:57:51 +03:00
io feat(io): preserve source DWG version for files with version-locked data 2026-06-28 02:46:13 +03:00
modules feat(commands): integrate standard CAD commands and fix behavior gaps 2026-06-28 19:27:35 +03:00
plugin Fix 5: Allow backward-compatibility and add plugin-template-v2 2026-06-25 00:02:17 +03:00
scene fix(block-cache): address PR211 review follow-ups 2026-06-28 21:57:51 +03:00
shaders perf(render): hoist per-wire constants to a storage buffer (native) 2026-06-26 10:39:23 +03:00
ui fix(shortcuts): honor Cmd as the accelerator modifier on macOS (#202) (#206) 2026-06-27 19:33:08 +03:00
cli.rs Initial commit 2026-06-25 00:01:36 +03:00
command.rs chore: remove dead extend stub, flatten single-file module dirs 2026-06-26 23:00:26 +03:00
lib.rs refactor: move resource/IO root modules under io/ 2026-06-26 23:06:40 +03:00
main.rs refactor: move resource/IO root modules under io/ 2026-06-26 23:06:40 +03:00
par.rs feat(wasm): sequential rayon shim for the web build 2026-06-16 17:11:20 +03:00
snap.rs chore: remove dead extend stub, flatten single-file module dirs 2026-06-26 23:00:26 +03:00
sys.rs fix(web): paste clipboard text into the TEXT / MText editors 2026-06-20 17:05:02 +03:00