-
Notifications
You must be signed in to change notification settings - Fork 442
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
Heap overflow during hts_md5_update
#1693
Comments
jkbonfield
added a commit
to jkbonfield/htslib
that referenced
this issue
Nov 16, 2023
Fixes samtools#1693 which read 1 byte beyond the end of the allocated c->ref array.
It appeared to be fixed by my fix for #1698. That wasn't actually a reuse-after-free bug, but a read buffer read overflow caused by an unmapped "alignment" starting a long way beyond the end of the specified reference. It happened to land within a block which had previously been freed. |
jkbonfield
added a commit
to jkbonfield/htslib
that referenced
this issue
Nov 16, 2023
Fixes samtools#1693 which read 1 byte beyond the end of the allocated c->ref array.
jkbonfield
added a commit
to jkbonfield/htslib
that referenced
this issue
Nov 16, 2023
Fixes samtools#1693 which read 1 byte beyond the end of the allocated c->ref array.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Heap-buffer overflow in
hts_md5_update
during parsing of a crafted SAM/FASTA file pair.Environment
Built using LLVM 14 with ASAN on Ubuntu 22.04
How to reproduce
Build with ASAN on latest commit like so:
Within the samtools folder, get poc file and reproduce with:
Which on my setup outputs:
Maybe it's related to #1692 ? The backtrace looks a bit different though (6th function is
cram_close
instead ofcram_flush
).The text was updated successfully, but these errors were encountered: