Malicious Code Injection in xapi-lib Package: A Critical Vulnerability

xapi-lib Updated 16 Oct 2026

Summary

15/10/2026
CRITICAL
No i
Critical
Not published

MAL-2026-17896: Malicious code in xapi-lib (npm). Affects xapi-lib versions 88.2.3 – 90.3.1. 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 xapi-lib package, available on npm, is designed to retrieve IP location and metadata. It is a lightweight package that primarily serves as a stub, lacking substantial library content. However, it has been compromised with malicious code that executes during installation, posing a significant risk to users.

Vulnerability Detail

The vulnerability arises from a preinstall hook in the xapi-lib package versions 88.2.3, 88.2.5, 90.2.1, and 90.3.1. This hook executes a script that sends an HTTP GET request to a hardcoded external URL (https://realwbx.com/ip.php) with a specific IP address and an Authorization header. This action occurs automatically during the npm install process, which can expose the installer's IP address to an unauthorized third-party server. The malicious nature of this code is underscored by its lack of documentation and the absence of any user-configurable options, making it a severe security threat.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall xapi-lib

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can avoid installing the affected versions of xapi-lib by specifying a version that is known to be safe or by using npm's --ignore-scripts flag during installation: npm install xapi-lib --ignore-scripts.

Conclusion

The xapi-lib package has been compromised with malicious code that executes during installation, posing a significant risk to users. It is essential to update to a patched version or use workarounds to mitigate this vulnerability. Regular monitoring of dependencies using tools like Vulert can help maintain security in your applications.

See every vulnerability recorded for xapi-lib →

Share this vulnerability

FAQ

xapi-lib is an npm package used for retrieving IP location and metadata.

The vulnerability manifests through a preinstall script that sends a request to an external server, exposing the user's IP address.

The affected versions are 88.2.3, 88.2.5, 90.2.1, and 90.3.1.

You can use Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

If you cannot update the package, consider using the workaround by installing the package with the --ignore-scripts flag to prevent the malicious code from executing.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall xapi-lib

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

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