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

Regexp.union [] gives wrong result in ruby 1.8 mode #2295

jeremyevans opened this Issue Dec 9, 2014 · 1 comment


None yet
3 participants
Copy link

jeremyevans commented Dec 9, 2014

With jruby 1.7.17 (and going back at least to 1.7.6 and probably longer), Regexp.union [] in ruby 1.8 mode gives // instead of /(?!)/. In ruby 1.9 mode, it gives /(?!)/. MRI 1.8.7 behavior is /(?!)/. So instead of the regexp matching nothing, this bug makes the regexp match everything.

While not a security vulnerability itself, this can potentially cause security vulnerabilities, if the result of the Regexp.union [] call is being used as a whitelist filter.

@enebo enebo added this to the JRuby 1.7.18 milestone Dec 9, 2014

@rtyler rtyler added the JRuby 1.7.x label Dec 9, 2014


This comment has been minimized.

Copy link

enebo commented Dec 10, 2014

Err Fixed in commit 62761f7.

@enebo enebo closed this Dec 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.