5

我刚刚在一个长期存在的域上启动了一个生产 Rails 应用程序(在 Heroku 上),当然,现在它面向广泛开放的网络,我正在收集所有尝试过的脚本小子的 flotsam 和 jetsam。

我有任何异常会通过电子邮件发送给我,并且我已经设法捕获(rescue_from)所有标准错误,但这每天都会出现几次:

An URI::InvalidURIError occurred in #:

bad URI(is not URI?): http://www.myapp.com/assets/,data:n,complete:function(e,t)
{r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u
vendor/ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:176:in `split'


-------------------------------
Request:
-------------------------------

 * URL       : http://myapp.com/assets/,data:n,complete:function(e,t)
{r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v(
 * IP address: 195.241.58.105
 * Parameters: {"v("=>nil, "path"=>"assets/,data:n,complete:function(e,t){r&&u.each(r,o||
[e.responseText,t,e])}}).done(function(e){o=arguments,u", "format"=>"html(i"}
 * Rails root: /app
 * Timestamp : 2013-02-26 16:53:51 UTC

所以从我未经训练的角度来看,这看起来像是脚本小子试图尝试某种漏洞(或?)

我的问题:

1) 这是我不确定“rails 魔法”能走多远的一个领域——我需要做些什么吗?我真的不喜欢外部力量能够仅从请求中在我的应用程序中导致异常。我应该拯救 URI::InvalidURIError 异常并抛出 404 吗?还有什么我应该做的吗?这会发生在每个人身上吗?

2) 是否配置错误,或者这只是应用程序的标准“库存生产”行为?我正在运行 Rails 3.2.12(截至本文发布的最新修补版本)。

提前感谢您的任何建议!

编辑:添加一些关于请求的更多细节,正如克里斯蒂安在下面指出的那样,可能不是脚本小子?不管怎样,我很好奇。

第二个要求:

An URI::InvalidURIError occurred in #:

bad URI(is not URI?): http://www.myapp.com/assets/&&!yt.test(e)&&
(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt
 vendor/ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:176:in `split'


-------------------------------
Request:
-------------------------------

 * URL       : http://myapp.com/assets/&&!yt.test(e)&&
(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||[
 * IP address: 217.16.182.42
 * Parameters: {"path"=>"assets/&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt", "format"=>"exec(e)||["}
 * Rails root: /app
 * Timestamp : 2013-02-27 18:37:20 UTC

第三个要求:

An URI::InvalidURIError occurred in #:

 bad URI(is not URI?): http://www.myapp.com/assets/&&!yt.test(e)&&
(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt
 vendor/ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:176:in `split'


-------------------------------
Request:
-------------------------------

 * URL       : http://myapp.com/assets/&&!yt.test(e)&&
(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||[
 * IP address: 62.141.42.107
 * Parameters: {"path"=>"assets/&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&
(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt", "format"=>"exec(e)||["}
 * Rails root: /app
 * Timestamp : 2013-02-27 20:56:25 UTC
4

2 回答 2

1

我刚刚在我的 production.log 中找到了该代码

GET "/assets/&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["

Rails 3.2.13 处理了它Completed 406 Not Acceptable

于 2013-03-28T14:22:17.303 回答
0

我在我的日志中发现了同样的情况,但在 2012 年 11 月:

ActionController::RoutingError (No route matches [GET] "/assets/&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["):

于 2013-03-29T15:03:25.340 回答