Kali Linux

Mininode : A CLI Tool To Reduce The Attack Surface Of The Node.js Applications By Using Static Analysis

Mininode is a CLI tool to reduce the attack surface of the Node.js applications by using static analysis of source code. It supports two modes of reduction (1) coarse, (2) fine.

Mininode constructs the dependency graph (modules and functions used) of the application starting from main file, i.e. entry point of the application. Mininode initializes entry point to package.json file’s main field if it exists. Otherwise default to index.js.

Example usage: node index.js <path to Node application root folder> --mode=(coarse|fine). Below is the list of options that can be passed to Mininode.

Options

List of command line options that can be passed to mininode.

  • --destination, -d: the path where mininode will save the reduced Node.js application. The default value: mininode.
  • --dry-run: just generates mininode.json without modifying the initial application.
  • --mode, -m: reduction mode. The value can be either coarse or fine. In coarse mode mininode will perform only coarse-grained reduction. While in fine mode mininode will perform fine-grained reduction. In general coarse-grained reduction is more reliable, because mininode will not try to reduce unused functions inside the module. Default value: coarse.
  • --silent: console output is disabled. This will improve the performance of the mininode.
  • --verbose: outputs additional information to the console. The default value: false
  • --log: mininode will generate log file inside, which contains dependency graph of the application in json format. The default value: true.
  • --log-output: the name of the log file generated by mininode. The default value: mininode.json.
  • --compress-log: compresses the final log file. By default it will dump everything into log file. In production it is advised to pass the --compress-log flag to save space.
  • --seeds: seed files from where mininode will start building dependency graph. You can provide many seed files by separating them with colon.
  • --skip-stat: skips calculating the statistics
  • --skip-reduction: if passed mininode will not reduce the JavaScript files. The default value: false.
  • --skip-remove: if passed mininode will not remove unused JavaScript files. The default value: false.

Limitaions

  • Mininode uses static analysis, which means it can not reduce the attack surface of the Node.js application which uses dynamic behaviour, such as eval. If Mininode detects dynamic behaviour in the application it exits with error DYNAMIC_BEHAVOUR_DETECTED.
R K

Recent Posts

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

1 week ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

2 weeks ago

Red Team Certification – A Comprehensive Guide To Advancing In Cybersecurity Operations

Embark on the journey of becoming a certified Red Team professional with our definitive guide.…

3 weeks ago

CVE-2024-5836 / CVE-2024-6778 : Chromium Sandbox Escape via Extension Exploits

This repository contains proof of concept exploits for CVE-2024-5836 and CVE-2024-6778, which are vulnerabilities within…

3 weeks ago

Rust BOFs – Unlocking New Potentials In Cobalt Strike

This took me like 4 days (+2 days for an update), but I got it…

3 weeks ago

MaLDAPtive – Pioneering LDAP SearchFilter Parsing And Security Framework

MaLDAPtive is a framework for LDAP SearchFilter parsing, obfuscation, deobfuscation and detection. Its foundation is…

3 weeks ago