ActiveRecord Vulnerability - Circumvention of attr_protected
groups.google.com
ActiveRecord Vulnerability - Circumvention of attr_protected
1–10 of 96 posts
Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#2 - @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/
+ @regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/
^ and $ only match the first line in ruby, whereas \A and \z match across all lines.Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#3https://groups.google.com/forum/?fromgroups=#!topic/rubyonra... (Rails 2.3 and 3.0)
https://groups.google.com/forum/?fromgroups=#!topic/rubyonra... (JSON library)
And in a short followup:
"To be clear, updating Rails doesn't necessarily mean the JSON gem will be updated. Please ensure that you are running JSON version 1.7.7, 1.6.8, or 1.5.5. You can do this by adding the dependency to your Gemfile." -- Aaron Patterson
Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#4This one seems pretty amateur and should have been caught as part of a pull request/code review process. - @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/ + @regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/ ^ and $ only match the first line in ruby, whereas \A and \z match across all lines.
Why not \Z, you ask? \Z will match to the end of the string but ignore a trailing newline.
irb(main):001:0> !!("hello\n" =~ /\Ahello\z/)
=> false
irb(main):002:0> !!("hello\n" =~ /\Ahello\Z/)
=> trueRe: ActiveRecord Vulnerability - Circumvention of attr_protected
#5Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#6This one seems pretty amateur and should have been caught as part of a pull request/code review process. - @regex = /^(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})$/ + @regex = /\A(#{Regexp.escape(@prefix)})(.+?)(#{Regexp.escape(@suffix)})\z/ ^ and $ only match the first line in ruby, whereas \A and \z match across all lines.
I say that about 95% of the bugs I ever see...especially ones written by me.
Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#7Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#8Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#9I don't use rails but it seems that the quality of releases have been going downhill over the pass months.
Re: ActiveRecord Vulnerability - Circumvention of attr_protected
#10I don't use rails but it seems that the quality of releases have been going downhill over the pass months.