forecast-tool
v1.0.2
Published
Forecast - prototype pollution detection tool
Readme
Forecast
This is the repository for Forecast, a tool for detecting prototype pollution vulnerability (CWE-1321).
For the information of prototype pollution, please refer to Snyk.io.
Overall framework
The Forecast framework comprises three phases:
Forced execution based Fuzzing, which generates function call templates as the sketch for generating exploits
Format-string Generation, which fill the function call templates with format strings
Exploit Generation, which generates the exploit with the placeholders in the function call templates filled with concrete values
Usage
Use npm run dist to build a standalone executable JavaScript file in dist directory.
Then use the following command:
node dist/forecast.js -hto show the help information. The supported options are listed as follows.
| Parameter | Usage |
| --------- | ----- |
| -h | Print help information |
| -a, --all | Find all sinks and exploits as possible |
| -p,--path | The path to a JavaScript library, represented as a relative or absolute path (e.g., ./path/to/lib or /path/to/lib/file.js) |
| --max-execution-time | Max count of forced execution of a function |
| --max-api-calls | Max number of the API calls in an exploit |
| -c, --candidate-only | Only output candidate API call paths |
| --using-meta-templates | Using meta templates (true by default) |
| --debug | Output debug information |
| --log-file | Output the logs to a specific file |
Note that the dependencies of the library should be installed first.
Requirements
Node.js version 20 and later
