
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
eslint-plugin-vuln-regex-detector
Advanced tools
Detect vulnerable regexes using the vuln-regex-detector module.
Detect unsafe regexes.
This plugin is not intended for use with your typical eslint runs. It uses the eslint framework to identify the files you care about and to have easy access to an AST from which to extract regexes.
It does work with as part of a regular eslint configuration. However, it will be slow the first few times eslint is triggered until the local cache warms up.
So, how should you use it?
I suggest adding this line to the scripts
section of your package.json
:
"test:regex": "eslint --plugin vuln-regex-detector --rule '\"vuln-regex-detector/no-vuln-regex\": 2' FILES_YOU_CARE_ABOUT",
Then when you run npm run test:regex
, you'll run your existing eslint rules plus identify vulnerable regexes in your code.
This is appropriate for use in your CI.
You should re-use your existing eslint invocation (see the lint
line in your package.json
scripts).
You might want to restrict the files you care about, since e.g. vulnerable regexes in test/
are probably not an issue.
The vuln-regex-detector module lets users specify the server hostname and port, as well as the local cache.
Invoke eslint with ESLINT_PLUGIN_NO_VULN_REGEX_HOSTNAME=... ESLINT_PLUGIN_NO_VULN_REGEX_PORT=...
.
Invoke eslint with ESLINT_PLUGIN_NO_VULN_REGEX_PERSISTENT_DIR=...
.
From an AWS micro instance, it takes about 30 seconds to scan a project with 100 regexes.
This plugin relies on vuln-regex-detector which queries a remote server about regexes. Once the server gives a firm response (it might say "unknown" for a few minutes), it gets cached locally in the FS. So after a few uses on the same machine, the plugin's performance will improve. The improvement will be significant if you have many regexes.
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-vuln-regex-detector
:
$ npm install eslint-plugin-vuln-regex-detector --save-dev
Note: If you installed ESLint globally (using the -g
flag) then you must also install eslint-plugin-vuln-regex-detector
globally.
If you want to use it in every eslint run, update your .eslintrc
configuration file as follows:
{
"plugins": [
"vuln-regex-detector"
]
}
{
"rules": {
"vuln-regex-detector/no-vuln-regex": 2
}
}
no-vuln-regex
: Identify vulnerable regexes in your code.FAQs
Detect vulnerable regexes using the vuln-regex-detector module.
The npm package eslint-plugin-vuln-regex-detector receives a total of 453 weekly downloads. As such, eslint-plugin-vuln-regex-detector popularity was classified as not popular.
We found that eslint-plugin-vuln-regex-detector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.