Repository navigation
Conversation
|
The overflow guard itself looks correct. I reproduced the range difference on current trunk: with a 64-bit The current three tests also pass on unmodified trunk, so they do not exercise the behavior changed here. Could you add a positive regression case that fails with the old The comment above The remaining RFC 9112 requires recipients to handle potentially large hexadecimal chunk sizes without integer-conversion overflow or precision loss; the new pre-shift check preserves that property while extending the accepted range. |
|
Devil's advocate: chunk sizes greater than 16-bit values are... unlikely and anything needing more than 24 bits is pathological. That new test is barely readable to me (a mere human) and the old code worked 100% of the time already. Why? |
|
Plus, the newly unreachable APR_ENOSPC path is going to trip a (future, smarter) compiler/static analyser and some poor engineer will have to explain why it doesn't matter. |
|
This was found with GPT Sol 6 Daybreak Blue (Cyber Security Model) during a run to try to win the zeroday.cloud RCE prize. I am commiting any non-qualifying fixes it finds. Take that for what it's worth.
|
Trunk already prevents the signed left shift in
parse_chunk_size()by limiting significant hex digits tosizeof(apr_off_t) * 8 - 4bits. That also rejects positive chunk sizes whose highest hex digit would fit in a signedapr_off_t(for example, a 16-digit size below0x8000000000000000on a 64-bit build).Use the full-width digit budget and check the accumulated prefix before each four-bit shift. The guard rejects a prefix that would shift into the sign bit; the existing
APR_ENOSPCpath still returns HTTP 413 for oversized values. Add three pyhttpd raw-socket cases for the first high-bit value, all-one hex digits, and leading zeroes.Validation
git diff --checkand Python syntax compilation passed.test/modules/http1120 passed, 2 skipped; the high-bit reproducer produced no ASan/UBSan diagnostic.README.CHANGESexempts fixes for regressions that existed only on trunk, so this draft has no changes entry.test/modules/http1.