CVE-2022-25760: Code Injection in accesslog

accesslog Updated 02 Oct 2025

Summary

18/03/2022
No i
High
7.1

CVE-2022-25760: Code injection in accesslog. Affects accesslog versions < 0.0.2. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The accesslog package is an npm package used for logging access to web servers. It provides a constructor function that allows users to format log messages. However, all versions of the package are vulnerable to Arbitrary Code Injection due to the usage of the Function constructor without input sanitization. This means that if an attacker-controlled user input is given to the format option of the constructor function, it is possible for the attacker to execute arbitrary JavaScript code on the host where this package is being run.

Vulnerability Detail

The vulnerability in the accesslog package arises from the lack of input sanitization when using the Function constructor. This allows an attacker to inject malicious JavaScript code into the log message format, which can then be executed on the host system. The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary code with the privileges of the user running the affected application. This could lead to unauthorized access, data leakage, or even complete compromise of the host system.

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 updating the package is not immediately feasible, a temporary workaround can be implemented by manually sanitizing and validating user input before passing it to the accesslog constructor function. This can be done by using a library or custom code to sanitize and validate the input according to the expected format of log messages.

Conclusion

In conclusion, the accesslog package is vulnerable to Arbitrary Code Injection due to the lack of input sanitization when using the Function constructor. This vulnerability can have severe consequences, including unauthorized access and data leakage. It is crucial to update to a patched version of the package and implement proper input sanitization to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for accesslog →

Share this vulnerability

FAQ

The impact of this vulnerability can be severe, as it allows an attacker to execute arbitrary JavaScript code on the host system. This could lead to unauthorized access, data leakage, or even complete compromise of the host system.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file and the playground will analyze it for any known vulnerabilities, including this one.

At the time of this advisory, there are no known public exploits specifically targeting this vulnerability. However, it is important to patch your application as soon as possible to mitigate the risk of potential exploits.

Yes, the maintainers of the accesslog package have released a fix in version 0.0.3 and later. It is recommended to update your package dependencies to the latest version that includes the fix.

To prevent code injection vulnerabilities, it is important to always sanitize and validate user input before using it in any context that could execute code. Additionally, keeping your dependencies up to date and regularly monitoring for security advisories can help mitigate the risk of such vulnerabilities.

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