
CVE-2026-22014에 대한 PoC 익스플로잇으로, 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 서버가 persisted queries를 지원하지만 queryId를 알 수 없는 경우 제공된 파라미터로 폴백합니다. 공격자는 존재하지 않는 와 임의의 GraphQL 쿼리를 함께 전달하여 의도된 persisted queries 허용 목록(allowlist)을 우회할 수 있습니다.
queryqueryIdqueryId를 찾지 못할 때 요청을 거부하는 대신 클라이언트가 제공한 query를 신뢰합니다.서버를 시작하고 혼합 페이로드를 전송합니다:
python exploit_persisted_query.py
서버가 악성 쿼리를 실행합니다.