.semgrep/pulse.yml runs in the Scan job alongside the registry packs. It has three rules:
Rule
What it blocks
pulse-no-vm
require('vm'), eval and new Function outside tests, so the workflow-condition bug (#62) can't come back
pulse-no-shell-in-server
exec/execSync, or spawn with a shell, in server.js and lib/. Running commands is the worker's job
pulse-innerhtml-unescaped
Member values (w.name, r.host, including inside template literals) inserted into innerHTML in public/assets without esc()/Pulse.esc(). Method names, comparisons, Set.has() and the fmt formatters don't count, because they aren't inserted values
Tests:.semgrep/pulse.js holds annotated cases (ruleid:/ok:), which CI checks with semgrep --test before the scan. A rule that stops matching therefore fails CI. I confirmed that flipping a single annotation makes the test fail.
Results: Pulse has no findings today. The innerHTML rule's first version flagged comparisons such as w.status === 'online'; I checked those by hand, and every inserted value in those lines already goes through esc().
Known limit: a value first copied into a plain variable isn't caught. The rule file says so, and that escaping should happen at the point of insertion.
Part of #45 (phase 4: custom semgrep rules).
`.semgrep/pulse.yml` runs in the Scan job alongside the registry packs. It has three rules:
| Rule | What it blocks |
|---|---|
| `pulse-no-vm` | `require('vm')`, `eval` and `new Function` outside tests, so the workflow-condition bug (#62) can't come back |
| `pulse-no-shell-in-server` | `exec`/`execSync`, or `spawn` with a shell, in `server.js` and `lib/`. Running commands is the worker's job |
| `pulse-innerhtml-unescaped` | Member values (`w.name`, `r.host`, including inside template literals) inserted into `innerHTML` in `public/assets` without `esc()`/`Pulse.esc()`. Method names, comparisons, `Set.has()` and the `fmt` formatters don't count, because they aren't inserted values |
**Tests:** `.semgrep/pulse.js` holds annotated cases (`ruleid:`/`ok:`), which CI checks with `semgrep --test` before the scan. A rule that stops matching therefore fails CI. I confirmed that flipping a single annotation makes the test fail.
**Results:** Pulse has no findings today. The `innerHTML` rule's first version flagged comparisons such as `w.status === 'online'`; I checked those by hand, and every inserted value in those lines already goes through `esc()`.
**Known limit:** a value first copied into a plain variable isn't caught. The rule file says so, and that escaping should happen at the point of insertion.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
.semgrep/pulse.yml, run in the Scan job next to the registry packs:
- pulse-no-vm: no require('vm'), eval or new Function outside tests (the
workflow-condition bug from #62 can't come back).
- pulse-no-shell-in-server: server.js and lib/ may not use exec/execSync
or spawn with a shell; running commands is the worker's job.
- pulse-innerhtml-unescaped: member values (w.name, r.host) inserted into
innerHTML in public/assets must go through esc()/Pulse.esc(); method
names, comparisons, Set.has() and the fmt formatters are not values.
The rules' test cases (.semgrep/pulse.js) run first with semgrep --test,
so a rule that stops matching fails CI. Pulse has no findings today.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jared
merged commit 72933df47a into main2026-11-22 23:10:41 -05:00
jared
deleted branch semgrep-rules2026-11-22 23:10:42 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of #45 (phase 4: custom semgrep rules).
.semgrep/pulse.ymlruns in the Scan job alongside the registry packs. It has three rules:pulse-no-vmrequire('vm'),evalandnew Functionoutside tests, so the workflow-condition bug (#62) can't come backpulse-no-shell-in-serverexec/execSync, orspawnwith a shell, inserver.jsandlib/. Running commands is the worker's jobpulse-innerhtml-unescapedw.name,r.host, including inside template literals) inserted intoinnerHTMLinpublic/assetswithoutesc()/Pulse.esc(). Method names, comparisons,Set.has()and thefmtformatters don't count, because they aren't inserted valuesTests:
.semgrep/pulse.jsholds annotated cases (ruleid:/ok:), which CI checks withsemgrep --testbefore the scan. A rule that stops matching therefore fails CI. I confirmed that flipping a single annotation makes the test fail.Results: Pulse has no findings today. The
innerHTMLrule's first version flagged comparisons such asw.status === 'online'; I checked those by hand, and every inserted value in those lines already goes throughesc().Known limit: a value first copied into a plain variable isn't caught. The rule file says so, and that escaping should happen at the point of insertion.
🤖 Generated with Claude Code
.semgrep/pulse.yml, run in the Scan job next to the registry packs: - pulse-no-vm: no require('vm'), eval or new Function outside tests (the workflow-condition bug from #62 can't come back). - pulse-no-shell-in-server: server.js and lib/ may not use exec/execSync or spawn with a shell; running commands is the worker's job. - pulse-innerhtml-unescaped: member values (w.name, r.host) inserted into innerHTML in public/assets must go through esc()/Pulse.esc(); method names, comparisons, Set.has() and the fmt formatters are not values. The rules' test cases (.semgrep/pulse.js) run first with semgrep --test, so a rule that stops matching fails CI. Pulse has no findings today. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>