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

Fixed crash with sigabort on invalid surrogate sequence #156

Closed

Conversation

michaelkruglos
Copy link

Example code to reproduce, before this fix is applied:

1.9.3-p484 :002 > Yajl::Parser.parse('["\\ud800\\\\a"]')
irb: yajl_encode.c:192: yajl_string_decode: Assertion `"this should never happen" == ((void *)0)' failed.
Aborted

1.9.3-p484 :001 > require 'yajl'
 => true 
1.9.3-p484 :002 >       Yajl::Parser.parse('["\\ud800\\\\u"]')
irb: yajl_encode.c:108: hexToDigit: Assertion `!(c & 0xF0)' failed.
Aborted

If a specifically crafted JSON is sent to a server, which uses yajl-ruby, it can cause the server to crash, thus potentially creating a DOS attack vector.

@michaelkruglos
Copy link
Author

The failures on Travis CI, seem to be related to some environment problem there.

@brianmario
Copy link
Owner

Closing this in favor of the simpler approach in #178 - apologies for not getting to this sooner!

@brianmario brianmario closed this Dec 18, 2017
@michaelkruglos michaelkruglos deleted the surrogate_crash branch January 21, 2018 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants