-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
[bug] nokogiri-1.11.0-x86_64-linux causes Active Support failure #2168
Comments
Thanks for reporting, I'll take a look. |
Just a note for lurkers: In order to set up the failure, I needed to I've reproduced this (on |
OK - this isn't an issue with the precompiled gems, this is an issue with |
git bisect indicates this is the offending commit:
|
OK, there's a couple of things going on here. First, here's the test that's failing: def test_exception_thrown_on_expansion_attack
assert_raise expansion_attack_error do
Hash.from_xml(<<~eoxml)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE member [
<!ENTITY a "&b;&b;&b;&b;&b;&b;&b;&b;&b;&b;">
<!ENTITY b "&c;&c;&c;&c;&c;&c;&c;&c;&c;&c;">
<!ENTITY c "&d;&d;&d;&d;&d;&d;&d;&d;&d;&d;">
<!ENTITY d "&e;&e;&e;&e;&e;&e;&e;&e;&e;&e;">
<!ENTITY e "&f;&f;&f;&f;&f;&f;&f;&f;&f;&f;">
<!ENTITY f "&g;&g;&g;&g;&g;&g;&g;&g;&g;&g;">
<!ENTITY g "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
]>
<member>
&a;
</member>
eoxml
end
end This is supposed to be testing for a RuntimeError when an XXE attack doc is parsed. Unfortunately, this is not what's being tested. Because the xml string is created with Second, the change made within nokogiri in commit 771164d avoids clobbering the global error handler used by libxml2. Unfortunately, it looks like a handler has been set up that has been trapping the fatal error in this test (possibly Points to investigate:
Things to do now:
Things to do later:
|
I've confirmed that The approach I'd like to take here is to set up the test suite to set a foreign handler before every test, and assert that it doesn't get called. This should expose the areas in which we have poor handler hygiene, and give me a failing test (or many of them) to make pass. This will take a few more hours, but the net result will be:
|
to check that we're setting error handlers everywhere we need to. Related to #2168
to check that we're setting error handlers everywhere we need to. Related to #2168
#2169 has been merged, I'm planning to ship a release for this tonight. |
Release v1.11.1 / 2021-01-06 has been shipped with this fix. |
Please describe the bug
Rails CI got failed using
nokogiri-1.11.0-x86_64-linux
native gem. It does not reproduce without native gem ornokogiri-1.11.0-x86_64-darwin
This issue has been reported at rails/rails#41015 first.
Help us reproduce what you're seeing
Expected behavior
It should pass.
Actual behavior
Environment
Additional context
The text was updated successfully, but these errors were encountered: