CVE-2023-23684 is a medium-severity (CVSS 4.4) Server-Side Request Forgery (SSRF) vulnerability in wp-graphql/wp-graphql. A fix is available for wp-graphql/wp-graphql — see the affected versions and patch details below.
WordPress WPGraphQL Plugin <= 1.14.5 is vulnerable to Server Side Request Forgery (SSRF)
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
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.6composer require wp-graphql/wp-graphql:^1.14.6 |
Affected Products
wpgraphqlwpengineDetection & 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, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
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 CVE-2023-23684 is resolved across your whole dependency graph.
Workarounds
Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
Frequently Asked Questions
Is CVE-2023-23684 in your dependencies?
Find it across Packagist, including transitive dependencies.