KeystoneJS maxTake Bypass (CVE-2026-63421): How to Fix
TL;DR: CVE-2026-63421 lets a negative take bypass graphql.maxTake in KeystoneJS (@keystone-6/core 6.5.2 and earlier): upgrade to 6.5.3 or later. Only projects that set graphql.maxTake on a list are affected, and on that list one GraphQL query can return more items than the limit allows. If you cannot upgrade yet, block negative take values. Haxset found the flaw with its AI SAST and reported it to the Keystone maintainers.
Key points
- The advisory rates the flaw High, with a CVSS 3.1 score of 7.5, and scores impact on availability only.1
- An attacker can use the flaw only on lists they are allowed to query, and gets more of the items they could already read.
- List queries and to-many relationship fields both reach the faulty check, so a workaround has to cover both.
- Haxset's AI SAST, a module of the Haxset Engine, found the vulnerability, and the advisory credits Haxset as the reporter.
Which KeystoneJS projects are affected?
The advisory lists @keystone-6/core 6.5.2 and earlier as affected, for projects "relying on graphql.maxTake to bound the number of items returned per query".1
The Keystone maintainers published the advisory, GHSA-cqmq-8755-7xvh, on 1 July 2026. It lists two weaknesses: CWE-20, Improper Input Validation, and CWE-480, Use of Incorrect Operator. The advisory credits Haxset as the reporter.1
In 6.5.2, graphql.maxTake is a per-list setting, and a list without it accepts any take, so it has no limit to bypass.2 Upgrading does not bound such a list. Setting maxTake does.
How does the negative take bypass work?
In 6.5.2, the findMany resolver checks take against maxTake with a plain greater-than comparison, which a negative take of any size passes. A negative number is never greater than the limit. Version 6.5.3 changes that one line to compare the absolute value:2
hljs diff- if ((take ?? Infinity) > maxTake) {
+ if (Math.abs(take ?? Infinity) > maxTake) {
After the check, the 6.5.2 resolver passes take unchanged to the Prisma query that reads the list. Prisma counts a negative take from the end of the list.3 On a list limited to 3, take: -5 asks for the last five items.
The fix's tests send this query to a Post list with maxTake: 3:2
hljs graphqlquery {
posts(take: -5) {
id
}
}
A second test sends the same take through a user's posts relationship field: user(where: { id: "..." }) { posts(take: -5) { id } }. On 6.5.3, both queries fail with the error code KS_LIMITS_EXCEEDED and the message "Your request exceeded server limits".
Access control still applies. In the 6.5.2 resolver, the list's access rules filter the same query, so an attacker gets only items they could already read.
The advisory's CVSS vector scores availability impact as high and confidentiality and integrity impact as none. It also says no privileges are needed.1 That holds for lists anyone can query. On a list whose query access requires sign-in, an attacker needs an account first.
How do I fix CVE-2026-63421?
Upgrade @keystone-6/core to 6.5.3 or later and restart the server. The advisory names 6.5.3 as the patched version.1
If you cannot upgrade yet, use the advisory's workaround. It says you can work around the flaw "by restricting take input values in your GraphQL queries to the bounded value, or by blocking negative values".1 Apply the workaround to every list query and every to-many relationship field, because in 6.5.2 both go through the same findMany check.2 Check the value the server receives, including a take sent as a GraphQL variable, not only the query text.
Before you block negative values, check whether any client sends a negative take within the limit. Version 6.5.3 still accepts one, such as -3 on a list limited to 3. The upgrade keeps that client working, and the block breaks it.
How can I check whether my Keystone app is affected?
Check the installed version, then look for lists that set the limit:
npm ls @keystone-6/core
grep -rn "maxTake" --exclude-dir=node_modules .
The first command prints each installed copy of @keystone-6/core with its version. A copy at 6.5.2 or earlier is affected if the second command finds maxTake in a list's graphql settings.
To test a running server, use a test copy, not production. Send the query above with one of your list queries in place of posts. Set take to a negative number one past that list's limit, such as -21 for a limit of 20. A patched server answers with KS_LIMITS_EXCEEDED.2 An answer with no error means the server does not enforce the limit for negative values.
How Haxset can help
Haxset's AI SAST reads source code with an AI agent per vulnerability class, and a validator checks each finding before the report is built. Haxset does not keep the prompts its AI models process and does not train models on them. It stores only scan metadata and scan results. To run it on your own code, contact us.
Related research
References
-
KeystoneJS, graphql.maxTake bypass with negative take (GHSA-cqmq-8755-7xvh, CVE-2026-63421), GitHub security advisory, 1 July 2026. ↩ ↩2 ↩3 ↩4 ↩5 ↩6
-
KeystoneJS, Backport enforce maxTake for negative take values (#9859) and its commit 9fb88b2 with tests, released in @keystone-6/core 6.5.3 on 1 July 2026, and the vulnerable resolvers.ts in 6.5.2. ↩ ↩2 ↩3 ↩4 ↩5
-
Prisma, Prisma Client API reference, findMany options, the take option. ↩
Interested in how this research applies to your organization?
Get in touch
