CVE-2022-25871: Prototype Pollution in querymen

querymen Updated 02 Oct 2025

Summary

18/06/2022
No i
Moderate
5.9

CVE-2022-25871: Prototype Pollution in querymen. Affects querymen versions < 2.1.4. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

querymen is an npm package that provides a middleware for building complex queries in Node.js applications. It allows users to define query parameters and handle them in a flexible manner. However, all versions of querymen are vulnerable to Prototype Pollution if the parameters of the exported function handler(type, name, fn) can be controlled by users without any sanitization.

Vulnerability Detail

Prototype Pollution is a vulnerability that occurs when an attacker can inject properties into existing objects, leading to unexpected behavior or privilege escalation. In the case of querymen, this vulnerability arises from an incomplete fix of a previous vulnerability (CVE-2020-7600). If an attacker can manipulate the parameters of the handler function, they can pollute the prototype chain and potentially modify or access sensitive data. This could result in unauthorized access, data manipulation, or other security breaches.

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

If you are unable to immediately update querymen, a temporary workaround is to manually sanitize the parameters passed to the handler function. Ensure that any user-controlled input is properly validated and sanitized before using it in the handler. Here's an example of how you can sanitize the 'type' parameter using the 'lodash' library:

const _ = require('lodash');

function handler(type, name, fn) {
  const sanitizedType = _.isString(type) ? type : '';
  // Rest of the handler logic
}

Conclusion

In conclusion, querymen is vulnerable to Prototype Pollution if the parameters of the handler function can be controlled by users without proper sanitization. It is crucial to update to the latest version of querymen (2.1.5 or later) to fix this vulnerability. If immediate update is not possible, ensure that user-controlled input is properly validated and sanitized before using it in the handler. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for querymen →

Share this vulnerability

FAQ

querymen is an npm package that provides a middleware for building complex queries in Node.js applications. It simplifies the process of handling query parameters and allows for flexible query construction.

Prototype Pollution is a vulnerability that occurs when an attacker can inject properties into existing objects, leading to unexpected behavior or privilege escalation. It is a common vulnerability in JavaScript applications.

This vulnerability allows an attacker to manipulate the parameters of the handler function in querymen, potentially leading to unauthorized access, data manipulation, or other security breaches.

Yes, the maintainers of querymen have addressed this vulnerability in version 2.1.5 and later. It is recommended to update to the latest version to mitigate the risk.

If you are unable to immediately update querymen, you can manually sanitize the parameters passed to the handler function to mitigate the risk. Ensure that any user-controlled input is properly validated and sanitized before using it in the handler.

Related vulnerabilities

Recent vulnerabilities recorded for querymen.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback