This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQueryでクロスドメイン読み込みを全般的に禁止する | |
// Note: 同一ドメインにオープンリダイレクタがないか確認すること | |
(function($){ | |
var gethost = function(url){ | |
var a = document.createElement("a"); | |
a.href = url; | |
return a.host | |
}; | |
var old_beforesend = $.ajaxSettings.beforeSend; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery MobileのloadPageで異なるホストを弾く | |
// Note: 同一ドメインにオープンリダイレクタがないか確認すること | |
(function($){ | |
var old = $.mobile.loadPage; | |
var gethost = function(url){ | |
var a = document.createElement("a"); | |
a.href = url; | |
return a.host | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>JSON Hijacking Test</title> | |
</head> | |
<body> | |
<script> | |
Object.prototype.__defineSetter__('test', function(val){ alert(val); return val }); | |
a = [ {"test": "hoge"} ]; | |
b = {"hoge": "hoge"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handle HTML strings | |
if ( typeof selector === "string" ) { | |
var mode, id, tag; | |
if (/^#[\w\-]*$/.test(selector)) { // single #id | |
mode = "id"; | |
id = selector.substring(1); | |
} else if (/^\s*<[\w\W]+>.*/.test(selector)) { // at least one html tag | |
mode = "html"; | |
} else { // selector expr | |
mode = "expr"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
use strict; | |
use Carp::REPL qw(repl); | |
sub { | |
my $env = shift; | |
my $message= "hello"; | |
repl(); # $message .= "world"; :q | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Coro; | |
use Coro::Channel; | |
use Plack::Request; | |
my %CHANNEL; | |
my %SUBSCRIBER; | |
my %CALLBACKS; | |
my $count = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.kyosuke.jp/yugajs/#"></a><img src=/ onerror=alert(1)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** アクセス解析の類を設置するサイト運営者の一般的な想定 | |
http://www.ninja.co.jp/rule/analyze | |
図1 | |
訪問者 → 忍者ツールズ → 業務提携先 | |
↓ | |
サイト運営者 | |
この場合、業務提携先、業務委託先に「忍者ツールズが知っているデータ」の中で「忍者ツールズが第三者に提供しても大丈夫だと考えている情報」が共有されることになる。 | |
それは利用規約とかプライバシーポリシーに、統計データのみとか、個人を特定できないようにするとか、必要な範囲でとか、守秘義務を結んだ上で、とか書かれるのが一般的。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
jQuery.fn.__init = jQuery.fn.init; | |
var old_expr = /^(?:[^<]*(<[\w\W]+>)[^>]*$)/; | |
var strict_expr = /^\s*</; | |
jQuery.fn.init = function(selector, context, rootjQuery){ | |
if (typeof selector === "string") { | |
// console.log(selector); | |
if (old_expr.test(selector) && !strict_expr.test(selector)) { | |
throw 'Syntax error, html string must start with "<"'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://twitter.com/bulkneets/status/224725678833147904 | |
ってのを書いたわけだけど | |
元ネタは覚えてる人居ないかもしれないけど、ココらへんの話ねー | |
http://internet.watch.impress.co.jp/docs/news/20090728_305316.html | |
http://mixi.co.jp/press/2009/0727/1691/ | |
で、後々、携帯電話会社とちゃんと連携して、契約者の年齢わかるようにした。 | |
http://mixi.co.jp/press/2011/0119/4179/ |