Skip to content

Instantly share code, notes, and snippets.

View azu's full-sized avatar

azu azu

View GitHub Profile
@azu
azu / 2022.08.23-ubuntu-18.04u.yml
Last active August 23, 2022 13:57
shepherd script: update ubuntu-18.04 to ubuntu-latest on GitHub Actions
id: 2022.08.23-ubuntu-18.04
title: "CI: update ubuntu-18.04 to ubuntu-latest"
adapter:
type: github
search_type: code
search_query: org:{{user}} path:/.github/workflows
hooks:
should_migrate:
- ls .github/workflows
- find .github/workflows -type f -name "*.y*ml" -exec grep "ubuntu-18.04" {} +;
@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 はメールアドレスの確認をしないでアカウントを作れるサービスという前提があります。

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

@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active March 13, 2024 17:32
Unofficial R2 notes
@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)やこの挙動を組み合わせた別の脆弱性に利用できる場合がある。

@Jaid
Jaid / migratingRules.md
Last active October 30, 2025 07:22
ESLint rules for migrating projects from CommonJS to ESM

ESLint rules

The ESM standard is considered stable in NodeJS and well supported by a lot of modern JavaScript tools.

ESLint does a good job validating and fixing ESM code (as long as you don't use top-level await, coming in ESLint v8). Make sure to enable the latest ECMA features in the ESLint config.

  • .eslint.json
{
@azu
azu / get-domain.js
Last active June 24, 2021 03:09
Get domain(site) from url using document.cookie hacking. without public suffix
const isSite = (domain) => {
console.log(domain)
const key = "WILL_BE_FIRED." + 'xxxx-xxxx-xxx-xxxx'.replace(/[x]/g, (c) => {
const r = Math.floor(Math.random() * 16);
return r.toString(16);
});
document.cookie = `${key}=1; domain=${domain}; samesite`;
// Test wrinting
console.log("document.cookie", document.cookie)
const canWrite = document.cookie.includes(`${key}=1`);
@azu
azu / 英語 文書 翻訳 読む ツール まとめ.md
Last active October 30, 2024 10:32
英語の文書を翻訳して読むときのツールのまとめ
@azu
azu / README.md
Created June 6, 2021 07:13
Decrypt and restore iOS backup(`Manifest.db` is encrypted) for restoring my iOS photos.

Setup

Use https://github.com/jfarley248/iTunes_Backup_Reader

git clone https://github.com/jfarley248/iTunes_Backup_Reader
cd iTunes_Backup_Reader
# apply https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
gh pr checkout https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
@azu
azu / ua-client-hints.md
Last active July 13, 2021 07:33
User Agent client hintsのJavaScript APIとHTTP Header