GHSA-cfh4-7wq9-6pgg
MEDIUMWPGraphQL Plugin vulnerable to Server Side Request Forgery (SSRF)
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
wp-graphql/wp-graphqlReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Impact
Users with capabilities to upload media (editors and above) are succeptible to SSRF (Server-Side Request Forgery) when executing the createMediaItem Mutation.
Authenticated users making GraphQL requests that execute the createMediaItem could pass executable paths in the mutations filePath argument that could give them unwarranted access to the server.
It's recommended to update to WPGraphQL v1.14.6 or newer. If you're unable to do so, below is a snippet you can add to your functions.php (or similar) that filters the createMediaItem mutation's resolver.
Patches
Workarounds
If you're unable to upgrade to v1.14.6 or higher, you should be able to use the following snippet in your functions.php to override the vulnerable resolver.
This snippet has been tested as far back as WPGraphQL v0.15
add_filter( 'graphql_pre_resolve_field', function( $nil, $source, $args, $context, \GraphQL\Type\Definition\ResolveInfo $info, $type_name, $field_key, $field, $field_resolver ) {
if ( $info->fieldName !== 'createMediaItem' ) {
return $nil;
}
$input = $args['input'] ?? null;
if ( ! isset( $input['filePath'] ) ) {
return $nil;
}
$uploaded_file_url = $input['filePath'];
// Check that the filetype is allowed
$check_file = wp_check_filetype( $uploaded_file_url );
// if the file doesn't pass the check, throw an error
if ( ! $check_file['ext'] || ! $check_file['type'] || ! wp_http_validate_url( $uploaded_file_url ) ) {
throw new \GraphQL\Error\UserError( sprintf( __( 'Invalid filePath "%s"', 'wp-graphql' ), $input['filePath'] ) );
}
$protocol = wp_parse_url( $input['filePath'], PHP_URL_SCHEME );
// prevent the filePath from being submitted with a non-allowed protocols
$allowed_protocols = [ 'https', 'http', 'file' ];
if ( ! in_array( $protocol, $allowed_protocols, true ) ) {
throw new \GraphQL\Error\UserError( sprintf( __( 'Invalid protocol. "%1$s". Only "%2$s" allowed.', 'wp-graphql' ), $protocol, implode( '", "', $allowed_protocols ) ) );
}
return $nil;
}, 10, 9 );
References
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | wp-graphql/wp-graphql | all versions | 1.14.6 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for wp-graphql/wp-graphql. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update wp-graphql/wp-graphql to 1.14.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-cfh4-7wq9-6pgg is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-cfh4-7wq9-6pgg is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-cfh4-7wq9-6pgg. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-cfh4-7wq9-6pgg in your dependencies?
O3 detects GHSA-cfh4-7wq9-6pgg across Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.