TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Denial of Service and Unsafe Object Creation Vulnerability in JSON Gem

72 点作者 ontoillogical超过 12 年前

5 条评论

mapgrep超过 12 年前
&#62;`JSON.load` should <i>never</i> be given input from unknown sources. If you are processing JSON from an unknown source, <i>always</i> use `JSON.parse`.<p>This seems like poor method naming; I would not intuitively understand that "load" is far more dangerous than "parse."<p>Why not deprecate these and do names like<p>JSON.load_trusted<p>JSON.load_untrusted
评论 #5202908 未加载
评论 #5203042 未加载
评论 #5204160 未加载
Tho85超过 12 年前
Some details on how this can be exploited:<p><a href="http://www.zweitag.de/en/blog/ruby-on-rails-vulnerable-to-mass-assignment-and-sql-injection" rel="nofollow">http://www.zweitag.de/en/blog/ruby-on-rails-vulnerable-to-ma...</a>
评论 #5202613 未加载
评论 #5202620 未加载
评论 #5202852 未加载
lkrubner超过 12 年前
I apologize for the ignorant question, but how does Ruby survive this in normal operation?<p>"Since Ruby symbols are not garbage collected, this can result in a denial of service attack."<p>If you have a long running Ruby app,and it does not garbage collect symbols, then those symbols are... constants I guess?That survive till the app stops operating? So I guess the assumption is that no app should use too many symbols (and they don't use much memory anyway?)
评论 #5203110 未加载
评论 #5203193 未加载
评论 #5203101 未加载
benmmurphy超过 12 年前
also if you have done require 'json/add/rails' you are in for fun (<a href="https://github.com/ruby/ruby/blob/v1_9_2_381/ext/json/lib/json/add/rails.rb#L10" rel="nofollow">https://github.com/ruby/ruby/blob/v1_9_2_381/ext/json/lib/js...</a>)<p><pre><code> irb(main):001:0&#62; require 'json/add/rails' =&#62; true irb(main):002:0&#62; class Foo irb(main):003:1&#62; end =&#62; nil irb(main):004:0&#62; Foo.json_create({"x" =&#62; "bar"}) =&#62; #&#60;Foo:0x007fc5f3149540&#62; </code></pre> <a href="https://github.com/search?q=require+%27json%2Fadd%2Frails%27&#38;type=Code&#38;ref=searchresults" rel="nofollow">https://github.com/search?q=require+%27json%2Fadd%2Frails%27...</a>
zyang超过 12 年前
Is it Monday again?