Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check padding size #282

Open
reynir opened this issue Sep 30, 2024 · 0 comments
Open

Check padding size #282

reynir opened this issue Sep 30, 2024 · 0 comments

Comments

@reynir
Copy link
Contributor

reynir commented Sep 30, 2024

Neither in unpad or before calling unpad we check that the length is at least one from the offset before reading the last byte.

miragevpn/src/engine.ml

Lines 1394 to 1403 in 8d70130

let* () =
guard
(String.length dec >= hdr_len)
(`Payload_too_short (hdr_len, String.length dec))
in
(* TODO validate replay packet id and ordering *)
Log.debug (fun m ->
m "received replay packet id is %lu" (String.get_int32_be dec 0));
(* TODO validate ts if provided (avoid replay) *)
unpad AES.CBC.block_size dec hdr_len

Previous discussion: #279 (comment)

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

No branches or pull requests

1 participant