Skip to content

Reject odd-length hex to prevent reading data from outside of buffer.#155

Open
elnerd wants to merge 1 commit into
lighttpd:masterfrom
elnerd:patch-1
Open

Reject odd-length hex to prevent reading data from outside of buffer.#155
elnerd wants to merge 1 commit into
lighttpd:masterfrom
elnerd:patch-1

Conversation

@elnerd
Copy link
Copy Markdown

@elnerd elnerd commented Apr 28, 2026

When the input hex has odd length, li_hex2bin will read outside of the input buffer.
Added check to disallow odd-length buffers.

1-byte heap-OOB READ in li_hex2bin when the input length is odd.
@gstrauss
Copy link
Copy Markdown
Member

gstrauss commented May 8, 2026

Current usage of li_hex2bin() inside lighttpd auth modules will not pass an odd length.

In any case, the sanity check is reasonable and I have accepted your patch. Thank you.

In the future, please match the whitespace style in with the surrounding code. Your one-line patch changed 4 spaces to a tab, and had extraneous trailing whitespace at the end of the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants