Avatar for the ada-url user
ada-url
ada
BlogDocsChangelog

Enforce max input length to the Ada URL parser

#1126Merged
Comparing
control_url_size
(
6f1efaa
) with
main
(
67b4245
)
CodSpeed Performance Gauge
-1%
Untouched
27
Skipped
4

Benchmarks

4 total
BasicBench_AdaURL_CanParse
benchmarks/benchmark_template.cpp
Skipped
67.9 ms*
BasicBench_AdaURL_aggregator_href
benchmarks/benchmark_template.cpp
Skipped
25.2 µs*
BasicBench_AdaURL_href
benchmarks/benchmark_template.cpp
Skipped
133.3 ms*
BasicBench_whatwg
benchmarks/benchmark_template.cpp
Skipped
213.7 ms*

Commits

Click on a commit to change the comparison range
Base
main
67b4245
-0.87%
This commit introduces max input length controls to the Ada URL parser library, adding ada::set_max_input_length() and ada::get_max_input_length() functions for configurable limits (defaulting to 4GB) to prevent DoS attacks and excessive memory usage. Key changes include a new get_href_size() method for efficient size calculation without allocation, enforcement checks in all parsers and setters with automatic reversion on limit exceedance, and comprehensive tests including unit tests in max_input_length.cpp and a fuzzing simulation in max_length_fuzzer.cpp. The implementation uses thread-safe atomics, preserves ABI compatibility by only adding new functions, and covers edge cases like percent-encoding expansion and cumulative setter operations.
43863ff
17 days ago
by lemire
0%
lint
4951691
17 days ago
by lemire
-3.63%
various fixes
2b7a1ff
17 days ago
by lemire
0%
lint
b1696a6
17 days ago
by lemire
-0.77%
saving a load
f5e49b0
17 days ago
by lemire
+4.36%
tuning
5763846
17 days ago
by lemire
-0.01%
lint/clean
6f1efaa
15 days ago
by lemire
© 2026 CodSpeed Technology
Home Terms Privacy Docs