Information Exposure Affecting next-auth package, versions <3.29.9 >=4.0.0 <4.10.2
Threat Intelligence
EPSS
0.05% (17th
percentile)
Do your applications use this vulnerable package?
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 applications- Snyk ID SNYK-JS-NEXTAUTH-2965597
- published 2 Aug 2022
- disclosed 2 Aug 2022
- credit ShuPink
Introduced: 2 Aug 2022
CVE-2022-31186 Open this link in a new tabHow to fix?
Upgrade next-auth
to version 3.29.9, 4.10.2 or higher.
Overview
next-auth is an Authentication for Next.js
Affected versions of this package are vulnerable to Information Exposure where it is possible to reveal sensitive information such as an identity provider's secret in logs.
Note: This vulnerability can be worked around by configuring the logger manually to remove the provider secret.
import log from "your-logging-service"
export const authOptions: NextAuthOptions = {
debug: process.env.NODE_ENV !== "production",
logger: {
error: (code, metadata) => {
if (!(metadata instanceof Error) && metadata.provider) {
// redact the provider secret here
delete metadata.provider
log.error(code, metadata)
} else {
log.error(code, metadata)
}
}
},
}
References
CVSS Scores
version 3.1