Skip to content
项目

关于

JavaScript & Node.js open-source SAST scanner. A static analyser for detecting most common malicious patterns 🔬.

安全与隐私

这些数字如何统计

可以做什么

  • Track require(), import, and dynamic imports with full variable tracing
  • Detect obfuscated code and identify the tool used (jsfuck, jjencode, obfuscator.io, and more)
  • Flag malicious patterns: data exfiltration, process.env serialization, unsafe shell commands
  • Detect vulnerable code: eval(), Function() constructor, ReDoS-prone regexes, SQL injection

实测星标增长

24小时
0
7天
+1
15天
+1
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

@nodesecure/js-x-ray

npm version license ossf scorecard slsa level3 github ci workflow

JS-X-Ray is a JavaScript & TypeScript SAST for identifying malicious patterns, security vulnerabilities, and code anomalies. Think of it as ESLint, but dedicated to security analysis. Originally created for NodeSecure CLI, JS-X-Ray has become an independent and serious option for supply chain protection.

🔎 How It Works

JS-X-Ray parses JS or TS code into an Abstract Syntax Tree (AST) with no extensive usage of RegEx or Semgrep rules. This enables variable tracing, dynamic import resolution, and detection of sophisticated obfuscation that pattern-matching tools miss. The tradeoff is that JS-X-Ray is purely dedicated to the JavaScript/TypeScript ecosystem.

💡 Features

  • Track require(), import, and dynamic imports with full variable tracing
  • Detect obfuscated code and identify the tool used (jsfuck, jjencode, obfuscator.io, and more)
  • Flag malicious patterns: data exfiltration, process.env serialization, unsafe shell commands
  • Detect vulnerable code: eval(), Function() constructor, ReDoS-prone regexes, SQL injection
  • Flag weak cryptographic algorithms (MD5, SHA1, etc.)
  • Extract infrastructure indicators: URLs, IPs, hostnames, emails
  • Configurable sensitivity modes (conservative/aggressive) and extensible probe system
  • Supports both JavaScript and TypeScript

💃 Getting Started

These packages are available in the Node package repository and can be easily installed with npm or yarn.

$ npm i @nodesecure/js-x-ray
# or
$ yarn add @nodesecure/js-x-ray

👀 Usage

import { AstAnalyser } from "@nodesecure/js-x-ray";

const scanner = new AstAnalyser();

const { warnings, dependencies } = await scanner.analyseFile("./file.js");

console.log(dependencies);
console.dir(warnings, { depth: null });

For the full API documentation, warning catalog, and advanced usage, see the @nodesecure/js-x-ray package README.

Workspaces

🐥 Contributors guide

If you are a developer looking to contribute to the project, you must first read the CONTRIBUTING guide.

Once you have finished your development, check that the tests (and linter) are still good by running the following script:

$ npm run check

[!CAUTION] In case you introduce a new feature or fix a bug, make sure to include tests for it as well.

Internal APIs

For contributors working on the JS-X-Ray internals, the following resources document low-level utilities and AST manipulation patterns:

Benchmarks

The performance of js-x-ray can be measured using mitata.

To run the benchmarks:

  1. Navigate to workspaces/js-x-ray.
  2. Run npm run bench.

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Gentilhomme
Gentilhomme

💻 📖 👀 🛡️ 🐛
Nicolas Hallaert
Nicolas Hallaert

📖
Antoine
Antoine

💻
Mathieu
Mathieu

💻
Vincent Dhennin
Vincent Dhennin

💻 ⚠️
Tony Gorez
Tony Gorez

💻 📖 ⚠️
PierreD
PierreD

⚠️ 💻
Franck Hallaert
Franck Hallaert

💻
Maji
Maji

💻
Michaël Zasso
Michaël Zasso

💻 🐛
Kouadio Fabrice Nguessan
Kouadio Fabrice Nguessan

🚧 💻
Jean
Jean

⚠️ 💻 📖
tchapacan
tchapacan

💻 ⚠️
mkarkkainen
mkarkkainen

💻
FredGuiou
FredGuiou

📖 💻
Madina
Madina

💻
SairussDev
SairussDev

💻
Abdou-Raouf ATARMLA
Abdou-Raouf ATARMLA

💻
Clement Gombauld
Clement Gombauld

💻 ⚠️
Ajāy
Ajāy

💻
Michael Mior
Michael Mior

📖
Hamed Mohamed
Hamed Mohamed

💻
Elie Patrice
Elie Patrice

⚠️
HoyeongJeon
HoyeongJeon

💻
Anne-Flore
Anne-Flore

💻
Resham
Resham

💻
Erwan Raulo
Erwan Raulo

💻
Victor Martins
Victor Martins

💻
Vinayak Deshmuk
Vinayak Deshmuk

💻

License

MIT

探索相关项目

加载中…