5

長く存在するドメインで (Heroku 上で) 実稼働の Rails アプリを立ち上げたところです。もちろん、広く開かれた Web に直面しているので、試みられたスクリプト キディのすべての flotsam と jetsam を拾っています。

メールでスローされる例外があり、すべての標準エラーをキャッチ (rescue_from) することができましたが、これは 1 日に数回発生し続けます。

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) これは、「レールの魔法」がどこまで通用するのかよくわからない領域の 1 つです。何かする必要はありますか? 外部の力がリクエストからだけでアプリに例外を引き起こすことができるのは本当に好きではありません. URI::InvalidURIError 例外をレスキューして、404 をスローする必要がありますか? もっとやるべきことはありますか?これは誰にでも起こりますか?

2) 何か設定が間違っているのでしょうか、それともアプリの標準的な「ストック プロダクション」動作ですか? Rails 3.2.12 を実行しています (この投稿時点での最新のパッチ適用済みバージョン)。

アドバイスをよろしくお願いします!

編集: Christian が以下で指摘したように、リクエストに関する詳細を追加することは、スクリプト キディではないでしょうか? いずれにせよ、私は興味があります。

2 番目の要求:

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

3 番目の要求:

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 に答える