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

Closed
jeremyevans opened this issue Dec 9, 2014 · 1 comment
Closed

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

jeremyevans opened this issue Dec 9, 2014 · 1 comment

Comments

@jeremyevans
Copy link
Contributor

@jeremyevans 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
@enebo
Copy link
Member

@enebo 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants