-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Multiple AddressSanitizer memory violations #351
Comments
When I get a chance I'll take a look. Any more information you can get would give me a head start. |
I tried to get AddressSanitizer setup in the makefile but I was not able to generate a bundle or .so file that could be used for testing. I also note that AddressSanitizer only works with macOS 10.x. I'm running v14.4 and it is not possible for me to revert to an OS that is 15 years old. Of course without AddressSanitizer Ox raises an error as it is supposed to. If you can give me some idea how to recreate the issue on a modern OS I'll see if I can recreate the issue and get it fixed. |
@ohler55 you should be able to reproduce the error on Linux. A virtual machine or Docker would probably work. Additionally, you have the option to fuzz the project in order to reproduce the error. Here is an example of a harness.: # frozen_string_literal: true
require 'ruzzy'
require 'ox'
test_one_input = lambda do |data|
begin
Ox.parse(data)
rescue Ox::ParseError, EncodingError
# pass
end
return 0
end
Ruzzy.fuzz(test_one_input) Works on Linux for me. |
Hi there,
I've been working on a new fuzzer for Ruby, and I used your library as a test harness. I've found a number of AddressSanitizer memory violations occurring when parsing malformed XML files. I haven't had time to dig into each one and confirm the bug, but I wanted to get them in front of you and see what you think. Note that reproducing these violations requires compiling the
ox
C extension with AddressSanitizer.I targeted two functions:
Ox.parse
andOx.sax_parse
.First,
Ox.parse
. I used the following harness to fuzz it:Fuzzing produced the following three violations:
stack-buffer-overflow
incollapse_special
Reproducer: crash-765a10b8075fbb3078b1c84f6449ce179280f013.txt
dynamic-stack-buffer-overflow
in_ox_err_set_with_location
Reproducer: crash-845de250117ca481b34ec7ade578f7065185ea89.txt
dynamic-stack-buffer-overflow
into_gen
Reproducer: crash-fa1ec0ff629bfbe275c6243bc63d7ee3e88c09c1.txt
Next,
Ox.sax_parse
. I used the following harness to fuzz it:Fuzzing produced one violation:
stack-buffer-underflow
inox_sax_buf_read
Reproducer: crash-08f111b2df6d628235c5e72ecfe464ae1913892d.txt
Related issues: #195.
The text was updated successfully, but these errors were encountered: