CVE-2021-23335: LDAP Injection in is-user-valid
Summary
CVE-2021-23335: LDAP Injection in is-user-valid. Affects is-user-valid versions < 1.1.2. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The is-user-valid package is an npm package used for user validation. It provides functionality to check if a user is valid based on certain criteria. The package is commonly used in web applications for user authentication and authorization. However, all versions of the package are vulnerable to LDAP Injection, which can lead to either authentication bypass or information exposure.
Vulnerability Detail
LDAP Injection is a type of attack where an attacker can manipulate LDAP queries by injecting malicious input. In the case of is-user-valid, this vulnerability allows an attacker to bypass authentication or gain unauthorized access to sensitive information. By injecting specially crafted input, an attacker can modify the LDAP query used for user validation, potentially bypassing any authentication checks or retrieving sensitive data. This vulnerability poses a high risk to the security of applications using the is-user-valid package.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, developers can implement input validation and sanitization to prevent LDAP Injection attacks. This involves validating and sanitizing user input before using it in LDAP queries. Here is an example of how input validation and sanitization can be done in JavaScript:
const sanitizeInput = (input) => {
// Implement input sanitization logic here
return sanitizedInput;
}
const userInput = req.body.username;
const sanitizedInput = sanitizeInput(userInput);
// Use sanitizedInput in LDAP query
Conclusion
The is-user-valid package is vulnerable to LDAP Injection, which can lead to authentication bypass or information exposure. It is crucial to update the package to a non-vulnerable version and implement input validation and sanitization to mitigate this vulnerability. For further support on vulnerability remediation, contact DevNack.com.
See every vulnerability recorded for is-user-valid →
FAQ
LDAP Injection is a type of attack where an attacker can manipulate LDAP queries by injecting malicious input. It can lead to authentication bypass or information exposure.
is-user-valid is an npm package used for user validation in web applications. It is vulnerable to LDAP Injection.
This vulnerability can allow attackers to bypass authentication or gain unauthorized access to sensitive information.
To fix this vulnerability, update the is-user-valid package to a non-vulnerable version and implement input validation and sanitization.
Yes, all versions of the is-user-valid package are vulnerable to LDAP Injection.