
CVE-2026-22014 用の概念実証エクスプロイト。GraphQL API の persisted-query ID を操作して許可リスト(allowlist)をバイパスし、任意のクエリを実行することを実証します。
// graphql_persisted.js - Accepts persisted query IDs
const express = require('express');
const { graphqlHTTP } = require('express-graphql');
const queries = {
"abc": "query { user { name } }"
};
app.post('/graphql', graphqlHTTP({
schema: schema,
customExecuteFn: (args) => {
const doc = parse(queries[args.queryId] || args.query);
return execute(args);
}
}));
GraphQL サーバーは永続化クエリをサポートしていますが、queryId が不明な場合は、提供された query パラメータにフォールバックします。攻撃者は存在しない と任意の GraphQL クエリを組み合わせて送信することで、意図された永続化クエリの許可リストを迂回できます。
queryIdqueryId が見つからない場合、リクエストを拒否する代わりに、クライアントが提供した query を信頼するため。サーバーを起動し、混合ペイロードを送信します:
python exploit_persisted_query.py
サーバーは悪意のあるクエリを実行します。