You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cbaae46
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,6 +54,15 @@ These targets mirror the GitHub Actions workflows. Run them locally before pushi
54
54
make test-rules
55
55
```
56
56
57
+
#### Rule Security Tests
58
+
59
+
-**Security tests** (`test/markdownlint-rules/security.test.js`): assert that invalid or malformed regex in rule config does not throw (defensive parsing).
60
+
A skipped test documents ReDoS risk when rules use user-controlled regex; enable it after adding mitigation (e.g. safe-regex or timeout).
61
+
-**Security lint**: `eslint-plugin-security` is enabled for `.markdownlint-rules` (via `make lint-js`) and forbids `eval`, `new Function`, `child_process`, non-literal `require`/`fs`/`Buffer`, and similar.
62
+
63
+
These execute as part of `make test-rules` and `make lint-js` respectively.
64
+
`make ci` includes these in all the checks it executes.
65
+
57
66
### Python Unit Tests (`make test-python`)
58
67
59
68
- Unit tests for `test-scripts/` in `test-scripts/test_*.py` (unittest).
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ Lint and docs-as-code tooling: custom [markdownlint](https://github.com/DavidAns
36
36
Do not register as a rule in markdownlint.
37
37
- Use when: copying the rule files; required by several of the rules above.
38
38
39
-
-**JS linting** for the rule code: ESLint (recommended + complexity/max-lines), aligned with the GitHub Actions workflow.
39
+
-**JS linting** for the rule code: ESLint (recommended + complexity/max-lines + eslint-plugin-security), aligned with the GitHub Actions workflow.
40
40
-**Markdownlint fixture tests**: [md_test_files/](md_test_files/README.md) includes positive/negative fixtures with explicit expected errors, verified by `test-scripts/verify_markdownlint_fixtures.py`.
41
-
-**Rule unit tests**: Node `node:test` unit tests for each custom rule in `test/markdownlint-rules/`; run with `make test-rules` or `npm run test:rules`.
41
+
-**Rule unit tests**: Node `node:test` unit tests for each custom rule in `test/markdownlint-rules/` (including security tests for defensive regex handling and ReDoS awareness); run with `make test-rules` or `npm run test:rules`.
42
42
-**Python unit tests**: `unittest` tests for [test-scripts/](test-scripts/README.md) in `test-scripts/test_*.py`; run with `make test-python`.
it("ReDoS: user-controlled regex can cause catastrophic backtracking (mitigation TBD)",{skip: "Current implementation is susceptible; enable when safe-regex or timeout is added."},()=>{
0 commit comments