Skip to content

Instantly share code, notes, and snippets.

View azu's full-sized avatar

azu azu

View GitHub Profile
@azu
azu / javascript-protocol-XSS.md
Last active August 25, 2025 21:15
<a href=javascript:alert(1) traget=_blank>XSS</a> behavior in modern browser.

Almost browsers prevent to XSS that is using javascript: protocol.

<a href=javascript:alert(location.origin) traget=_blank>XSS</a>

Demo: https://nuvjcp.csb.app/

Summary

@azu
azu / Pre-hijacking Attacks.md
Last active October 19, 2024 05:41
Pre-hijacking Attacksのメモ書きやSSO/パスワードリセット/アカウントマージ周りのチェックリスト

Pre-hijacking Attacksについてのメモ書きです。 元の論文と記事は次のページを読んでください。

Pre-hijacking Attacks はメールアドレスの確認をしないでアカウントを作れるサービスという前提があります。

アカウント作成からそのまま機能を利用できるようにすることで、利用体験をよくするための施策として、メールアドレスの確認のステップを後回し またはしないサービスがあります。

// ==UserScript==
// @name pinia: clean document
// @namespace https://pinia.vuejs.org/
// @match https://pinia.vuejs.org/*
// @grant none
// @version 1.0
// @author -
// @description Remove unreadable web fonts style
// @run-at document-end
// ==/UserScript==
@azu
azu / README.md
Last active November 2, 2022 08:00
サブドメインをユーザーホスティングサイトに使うときのパターン(Same Origin/Cookie/Public Suffix List)

サブドメインをユーザーホスティングサイトに使うときのパターン

hoge.example.com でユーザが作成したサイトをホスティングして、任意のJavaScriptを実行できる状態にしたいケース。 サブドメインを分けることで、Fetch APIなどはSame Origin Policyを基本にするため、別のサブドメインや example.com に対するリクエストなどはできなくなる。

一方で、CookieはSame Origin Policyではない。 デフォルトでは、hoge.example.com から example.com に対するCookieが設定できる。 これを利用したDoS(Cookie Bomb)やこの挙動を組み合わせた別の脆弱性に利用できる場合がある。

@azu
azu / github-proxy-client.js
Created March 13, 2022 13:02 — forked from DavidWells/github-proxy-client.js
Full Github REST api in 34 lines of code
/* Ultra lightweight Github REST Client */
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const token = 'github-token-here'
const githubClient = generateAPI('https://api.github.com', {
headers: {
'User-Agent': 'xyz',
'Authorization': `bearer ${token}`
}
})
@azu
azu / irdor-komesan.user.js
Last active January 24, 2022 14:53
Greamonkey Script: irodr integrate with komesan
// ==UserScript==
// @name irodr: komesan
// @namespace github.com/azu
// @match https://irodr.netlify.app/
// @grant none
// @version 1.0
// @author azu
// @description irodr integrate
// @run-at document-end
// ==/UserScript==
@azu
azu / commonjs-module.js
Last active January 12, 2022 11:30
webpack 5.66.0 add library type: commonjs-static
"use strict";
var __webpack_require__ = {
d: (_, e) => {
for (var r in e) __webpack_require__.o(e, r) && !__webpack_require__.o(_, r) && Object.defineProperty(_, r, {
enumerable: !0,
get: e[r]
})
}, o: (_, e) => Object.prototype.hasOwnProperty.call(_, e), r: _ => {
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(_, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(_, "__esModule", { value: !0 })
}