CVE-2021-43786
JavaScript vulnerability analysis and mitigation

Overview

NodeBB versions before 1.18.5 contained a critical authentication bypass vulnerability (CVE-2021-43786) in the token verification mechanism. The vulnerability allowed attackers to bypass API authentication and gain unauthorized master token access, which could lead to remote code execution capabilities on NodeBB instances. The issue was discovered and reported by Paul Gerste from SonarSource in October 2021 (SonarSource Blog, GitHub Advisory).

Technical details

The vulnerability existed in the token verification function where incorrect logic in the object creation and property lookup allowed attackers to exploit inherited properties from Object.prototype. When tokens were loaded, they were merged into an object where inherited properties like toString or constructor became valid Bearer tokens. The lookup checked if a property was present using the provided token as the key, which worked for these inherited properties. Since the values of inherited properties were either functions or objects, they would parse to NaN when checked, resulting in authentication succeeding with master privileges (SonarSource Blog).

Impact

The vulnerability allowed unauthenticated attackers to gain master token access to the API, which could be used to perform actions on behalf of any user, including administrators. This access could ultimately lead to remote code execution on the NodeBB server, regardless of its configuration. Attackers didn't need an account or any prior information to exploit the vulnerability (SonarSource Blog).

Mitigation and workarounds

The vulnerability was patched in NodeBB version 1.18.5. The fix involved changing the token verification logic to skip the conversion from array to object entirely and instead search the array for a matching entry. Users are strongly advised to upgrade to at least version 1.18.5. As a temporary workaround, users can cherry-pick commit hash 04dab1d to receive the patch without performing a full upgrade (GitHub Advisory, SonarSource Blog).

Community reactions

The NodeBB team responded quickly to the reported vulnerability, implementing and releasing patches promptly. They awarded a $1,536 bounty to the researcher for discovering the vulnerability. The security community highlighted the severity of this vulnerability due to its ease of exploitation and potential impact (SonarSource Blog).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-23744CRITICAL9.8
  • JavaScriptJavaScript
  • @mcpjam/inspector
NoYesJan 16, 2026
CVE-2026-23735HIGH8.7
  • JavaScriptJavaScript
  • graphql-modules
NoYesJan 16, 2026
GHSA-gw32-9rmw-qwwwHIGH8.4
  • JavaScriptJavaScript
  • svelte
NoYesJan 16, 2026
CVE-2026-23745HIGH8.2
  • JavaScriptJavaScript
  • tar
NoYesJan 16, 2026
GHSA-38cw-85xc-xr9xMEDIUM6.8
  • JavaScriptJavaScript
  • @veramo/data-store
NoYesJan 16, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management