Authentication Bypass in GitHub Webhook Verification via Missing X-Hub-Signature-256 Header
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- javascript, node.js
調査の方向性
まず templates/node/github-issue-bot/src/github.js を読み、提供されている node poc.js の再現を実行して、ヘッダーがない場合の動作を確認します。X-Hub-Signature-256 のないリクエストが拒否され、設定された webhook secret による暗号学的検証の後にのみリクエストが受け入れられれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Reproduction steps
Reproduction steps*
Clone the Appwrite templates repository:
git clone https://github.com/appwrite/templates.git
Navigate to the vulnerable template:
cd templates/node/github-issue-bot
Verify the vulnerable code exists:
grep -n "typeof signature" src/github.js
Output:
19: typeof signature !== 'string' ||
Inspect the vulnerable function:
sed -n '1,80p' src/github.js
Create a PoC file:
cat > poc.js << 'EOF'
async function verifyWebhook(req) {
const signature = req.headers['x-hub-signature-256'];
return (
typeof signature !== 'string' ||
true
);
}
(async () => {
const req = {
headers: {}
};
const result = await verifyWebhook(req);
console.log("[] Missing signature header");
console.log("[] verifyWebhook() returned:", result);
if (result === true) {
console.log("[+] Vulnerability confirmed");
} else {
console.log("[-] Not vulnerable");
}
})();
EOF
Execute the PoC:
node poc.js
Observe the output:
[] Missing signature header
[] verifyWebhook() returned: true
[+] Vulnerability confirmed
Additional verification:
node -e "const signature=undefined; console.log(typeof signature !== 'string' || false)"
Output:
true
This confirms that requests without the X-Hub-Signature-256 header are incorrectly treated as authenticated.
Expected behavior
Requests missing the X-Hub-Signature-256 webhook signature header should be rejected.
verifyWebhook() should return false unless the webhook signature is cryptographically verified using the configured webhook secret.
Actual Behavior
Requests without the X-Hub-Signature-256 header are treated as valid because of incorrect boolean logic:
typeof signature !== 'string' || verify(...)
When the header is missing, the first condition evaluates to true, causing the function to bypass signature verification entirely.
As a result, forged webhook requests may be accepted if the application relies on this function for authentication.
Appwrite version
Appwrite Cloud
Operating system
Linux
Your Environment
OS: Kali Linux
Runtime: Node.js
Repository: appwrite/templates
Component: node/github-issue-bot
File: src/github.js
Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
Have you read the Code of Conduct?
- I have read the Code of Conduct
- 主要言語
- HTML
- スター
- 174
- フォーク
- 129
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
appwrite/templates のほかの issue
-
🐛 Bug Report: query-redis-labs hardcodes Redis port 14714対応中かも @sundeep8967 が今日担当しました。 オープンbug javascript
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
🐛 Bug Report: discord-command-bot Python build fails in setup.py対応中かも @sundeep8967 が今日担当しました。 オープンbug python
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Dependency Dashboardオープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
メンテナーはふだん 1 日以内に返信
-
Enhancement: Add TypeScript definitions (IntelliSense) to Node.js starter対応中かも @Ram3ez が 327 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
appwrite/templates の issue をすべて見る
似ている issue
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"対応中かも @Daksha1611 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
good first issue size: XS
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
fells-code/seamless-glance#136 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#150942 ·
メンテナーはふだん 1 日以内に返信
-
Studio: OAuth app client secret is easy to miss after creating or regenerating it対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンexternal-issue to-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
メンテナーはふだん 1 日以内に返信