Skip to content

Commit ac7aa76

Browse files
1 parent 5ffb532 commit ac7aa76

2 files changed

Lines changed: 138 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-68jq-c3rv-pcrr",
4+
"modified": "2026-04-14T01:05:05Z",
5+
"published": "2026-04-14T01:05:05Z",
6+
"aliases": [],
7+
"summary": "graphql-php is affected by a Denial of Service via quadratic complexity in OverlappingFieldsCanBeMerged validation",
8+
"details": "The `OverlappingFieldsCanBeMerged` validation rule exhibits quadratic time complexity when processing queries with many repeated fields sharing the same response name. An attacker can send a crafted query like `{ hello hello hello ... }` with thousands of repeated fields, causing excessive CPU usage during validation before execution begins.\n\nThis is not mitigated by existing QueryDepth or QueryComplexity rules.\n\n**Observed impact (tested on v15.31.4):**\n- 1000 fields: ~0.6s\n- 2000 fields: ~2.4s\n- 3000 fields: ~5.3s\n- 5000 fields: request timeout (>20s)\n\n**Root cause:** `collectConflictsWithin()` performs O(n²) pairwise comparisons of all fields with the same response name. For identical repeated fields, every comparison returns \"no conflict\" but the quadratic iteration count causes resource exhaustion.\n\n**Fix:** Deduplicate structurally identical fields before pairwise comparison, reducing the complexity from O(n²) to O(u²) where u is the number of unique field signatures (typically 1 for this attack pattern).\n\n**Credit:** Ashwak N (ashwakn04@gmail.com)",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Packagist",
19+
"name": "webonyx/graphql-php"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "15.31.5"
30+
}
31+
]
32+
}
33+
],
34+
"database_specific": {
35+
"last_known_affected_version_range": "<= 15.31.4"
36+
}
37+
}
38+
],
39+
"references": [
40+
{
41+
"type": "WEB",
42+
"url": "https://github.com/webonyx/graphql-php/security/advisories/GHSA-68jq-c3rv-pcrr"
43+
},
44+
{
45+
"type": "PACKAGE",
46+
"url": "https://github.com/webonyx/graphql-php"
47+
},
48+
{
49+
"type": "WEB",
50+
"url": "https://github.com/webonyx/graphql-php/releases/tag/v15.31.5"
51+
}
52+
],
53+
"database_specific": {
54+
"cwe_ids": [
55+
"CWE-407"
56+
],
57+
"severity": "MODERATE",
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-04-14T01:05:05Z",
60+
"nvd_published_at": null
61+
}
62+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-cq8v-f236-94qc",
4+
"modified": "2026-04-14T01:03:36Z",
5+
"published": "2026-04-14T01:03:36Z",
6+
"aliases": [],
7+
"summary": "Rand is unsound with a custom logger using rand::rng()",
8+
"details": "It has been reported (by @lopopolo) that the `rand` library is [unsound](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#soundness-of-code--of-a-library) (i.e. that safe code using the public API can cause Undefined Behaviour) when all the following conditions are met:\n\n- The `log` and `thread_rng` features are enabled\n- A [custom logger](https://docs.rs/log/latest/log/#implementing-a-logger) is defined\n- The custom logger accesses `rand::rng()` (previously `rand::thread_rng()`) and calls any `TryRng` (previously `RngCore`) methods on `ThreadRng`\n- The `ThreadRng` (attempts to) reseed while called from the custom logger (this happens every 64 kB of generated data)\n- Trace-level logging is enabled or warn-level logging is enabled and the random source (the `getrandom` crate) is unable to provide a new seed\n\n`TryRng` (previously `RngCore`) methods for `ThreadRng` use `unsafe` code to cast `*mut BlockRng<ReseedingCore>` to `&mut BlockRng<ReseedingCore>`. When all the above conditions are met this results in an aliased mutable reference, violating the Stacked Borrows rules. Miri is able to detect this violation in sample code. Since construction of [aliased mutable references is Undefined Behaviour](https://doc.rust-lang.org/stable/nomicon/references.html), the behaviour of optimized builds is hard to predict.\n\nAffected versions of `rand` are `>= 0.7, < 0.9.3` and `0.10.0`.",
9+
"severity": [],
10+
"affected": [
11+
{
12+
"package": {
13+
"ecosystem": "crates.io",
14+
"name": "rand"
15+
},
16+
"ranges": [
17+
{
18+
"type": "ECOSYSTEM",
19+
"events": [
20+
{
21+
"introduced": "0.7.0"
22+
},
23+
{
24+
"fixed": "0.9.3"
25+
}
26+
]
27+
}
28+
]
29+
},
30+
{
31+
"package": {
32+
"ecosystem": "crates.io",
33+
"name": "rand"
34+
},
35+
"ranges": [
36+
{
37+
"type": "ECOSYSTEM",
38+
"events": [
39+
{
40+
"introduced": "0.10.0"
41+
},
42+
{
43+
"fixed": "0.10.1"
44+
}
45+
]
46+
}
47+
],
48+
"versions": [
49+
"0.10.0"
50+
]
51+
}
52+
],
53+
"references": [
54+
{
55+
"type": "WEB",
56+
"url": "https://github.com/rust-random/rand/pull/1763"
57+
},
58+
{
59+
"type": "PACKAGE",
60+
"url": "https://github.com/rust-random/rand"
61+
},
62+
{
63+
"type": "WEB",
64+
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0097.html"
65+
}
66+
],
67+
"database_specific": {
68+
"cwe_ids": [
69+
"CWE-20"
70+
],
71+
"severity": "LOW",
72+
"github_reviewed": true,
73+
"github_reviewed_at": "2026-04-14T01:03:36Z",
74+
"nvd_published_at": null
75+
}
76+
}

0 commit comments

Comments
 (0)