Security fixes are issued only for the latest 1.x release line.
| Version | Supported |
|---|---|
| 1.x | ✅ |
Please do not open a public GitHub issue for security problems.
Report vulnerabilities privately via GitHub's private vulnerability reporting form. This routes the report directly to the maintainer through a private advisory and keeps the details out of the public issue tracker until a fix is available.
When reporting, please include:
- The affected version(s) of
ts-rule-engine - A minimal reproduction (fact shape, rule definitions, observed vs expected behavior)
- The impact you believe the issue has (logic bypass, prototype pollution, denial of service, unbounded recursion, etc.)
- Acknowledgement: within 7 days of the report.
- Triage and fix window: targeted within 30 days for confirmed issues, depending on severity and complexity.
- Disclosure: coordinated via the GitHub advisory. A CVE will be requested where applicable, and a patched release will be published to npm with provenance attestations before the advisory is made public.
In scope:
- The
ts-rule-enginesource in this repository. - The published tarball on npm (
ts-rule-engine). - Rule evaluation, fact mutation tracking, iteration bounds, and the infinite-loop guard.
Out of scope:
- Vulnerabilities in development-only dependencies listed under
devDependencies, which do not ship in the published package. - Runtime behaviour caused by user-supplied
conditionoractioncallbacks that themselves contain insecure code: the engine executes those functions as provided and cannot sandbox them.
This section explains how ts-rule-engine defends against supply-chain
attacks of the kind that hit widely-used packages in 2025 (notably the
axios compromise, where a maintainer token was abused to publish
versions that pulled in a malicious transitive dependency running
obfuscated code via a postinstall lifecycle hook). Each defence below
maps to a concrete step in that attack chain.
- Zero runtime dependencies.
ts-rule-enginehas nodependenciesfield: deep cloning usesstructuredClone(a Node built-in from 17+), and deep equality uses an in-repo implementation. Consumers audit a dependency surface of one:ts-rule-engineitself. - No peer dependencies. The library runs standalone and does not pull anything into the consumer's install tree at peer resolution time.
package.jsonhas nopostinstall,preinstall, orpreparescript in the published manifest. Theprepare: simple-git-hooksentry was dropped in favour of a one-timenpx simple-git-hookscommand documented inCONTRIBUTING.md. Consumernpm installcannot execute any of our lifecycle code, and attackers who smuggle in a malicious transitive dep still cannot runpostinstallcode from this package.files: ["dist"]ships only thedist/directory. Nosrc, notests, notsconfig.json, novite.config.mts. The attack surface inside the tarball is strictly the pre-built JS bundle, not arbitrary TypeScript that could be re-executed.
- Releases are published via npm trusted publishing, not a
long-lived npm token. The
publish.yamlworkflow usesid-token: writeand lets npm verify the publish was triggered by a specific GitHub Actions workflow run on this repository via OIDC. There is noNPM_TOKENsecret that can be exfiltrated from the repo or a maintainer account. - The publish pipeline is split into two jobs so the tarball
that gets attested is the exact same one that gets published:
buildruns full CI,npm packs the tarball, signs it viaactions/attest@v4(Sigstore keyless OIDC → SLSA v1 build provenance attestation [predicate typehttps://slsa.dev/provenance/v1] uploaded to GitHub's native attestation store), then uploads the tarball as a workflow artifact;publishdownloads that artifact and runsnpm publish; npm-registry provenance is emitted automatically viapublishConfig.provenance: true. Every action in every workflow is SHA-pinned; there are no tag-pin exceptions.
SLSA v1.2's distributing-provenance guidance states that producers MUST publish attestations in at least one place and SHOULD publish in more than one, the rationale being that independent channels give consumers more than one way to verify and remove any single point of failure. This project publishes the same SLSA v1 build provenance in three independent channels on every release (with the third channel carrying two separate artifacts that target different verification tools, giving four attestation files in total across the three channels):
-
npm registry provenance: emitted automatically by
npm publishbecausepublishConfig.provenance: trueis set inpackage.json. Verifiable withnpm audit signatures. -
GitHub native attestation store: produced by
actions/attest@v4in thebuildjob. Stored at github.com/ilovepixelart/ts-rule-engine/attestations and verifiable throughgh attestation verify, with no extra tooling install required by consumers who already have theghCLI. -
GitHub Release assets: two sidecar files attached to the GitHub Release, carrying the same DSSE envelope at the innermost layer but in different outer containers for different verification flows:
<tarball>.sigstore.json: a straight copy ofactions/attest's output, a full Sigstore bundle (application/vnd.dev.sigstore.bundle.v0.3+json). Carries the Fulcio certificate and the Rekor inclusion proof inline, so consumers can verify offline without querying Rekor. Parsed bygh attestation verify --bundleand other Sigstore-native tooling.<tarball>.intoto.jsonl: a spec-compliant in-toto attestation v1 bundle: JSON Lines of DSSE envelopes, one envelope per line. Extracted from the Sigstore bundle viajq -c '.dsseEnvelope'; this is a genuine in-toto bundle, not a renamed Sigstore bundle. Parsed byslsa-verifier verify-artifact, which queries Rekor for the certificate and inclusion proof via the signature hash.
The two files are not duplicate signing material: they are the same cryptographic signature presented in two different container formats that different verification tools understand.
Status: releases from 1.4.5 onward carry npm registry
provenance; earlier releases carry none. 1.5.0 is the first release
built by the current publish.yaml, and every release from it on
ships npm provenance, GitHub attestation-store provenance, and both
release-asset sidecars.
- Dependabot proposes updates and never merges them. It opens
weekly pull requests for npm dependencies (minor and patch updates
grouped, majors after a 7-day cooldown, security updates without
delay) and for the SHA pins of GitHub Actions (see
.github/dependabot.yml). Each one passes the same CI as any other change and is merged by hand; no workflow auto-merges a dependency update. - CI action dependencies are SHA-pinned with trailing version comments, so a compromised upstream action's new tag cannot silently run with our privileges.
- Maintainer npm account uses 2FA / WebAuthn. This is the single defence that cannot be enforced from the repository: it is a maintainer-side responsibility. A reviewer auditing this project's supply-chain posture should treat it as a documented commitment: if 2FA were disabled, the OIDC trusted-publishing defence above would not fully protect against a session hijack.
Anyone integrating ts-rule-engine into a production pipeline
has four verification paths available, each exercising one of the
distribution channels documented above. Pick the one that matches
the tooling you already trust and the environment you're deploying
to; the trust model is identical (all four resolve to the same
Fulcio-issued certificate binding the signature to the exact
GitHub Actions workflow run). For releases earlier than 1.4.5,
npm audit signatures only verifies npm registry signatures,
because those releases carry no provenance.
Primary check (no extra tooling):
# Verifies npm provenance and registry signatures for all installed
# packages in one pass. Built into npm, no extra install required.
npm audit signatures
# Cross-checks the installed version against npm dist-tags.
npm view ts-rule-engine dist-tagsAdvanced check (independent of npm):
# Pull the tarball from the npm registry (or GitHub Release) first:
npm pack ts-rule-engine@X.Y.Z
# Verify against the attestation stored on GitHub:
gh attestation verify ts-rule-engine-X.Y.Z.tgz \
--repo ilovepixelart/ts-rule-engine \
--signer-workflow ilovepixelart/ts-rule-engine/.github/workflows/publish.yamlThe --signer-workflow flag pins the verification to the exact
workflow file that produced the attestation, a stronger claim than
just --repo alone, because it blocks any other workflow in the
same repository from producing attestations that would pass
verification.
Offline check via Sigstore bundle:
gh attestation verify ts-rule-engine-X.Y.Z.tgz \
--bundle ts-rule-engine-X.Y.Z.tgz.sigstore.json \
--repo ilovepixelart/ts-rule-engine \
--signer-workflow ilovepixelart/ts-rule-engine/.github/workflows/publish.yamlThird-party check via in-toto attestation bundle:
# Install once (needs Go toolchain):
go install github.com/slsa-framework/slsa-verifier/v2/cmd/slsa-verifier@latest
# Verify:
slsa-verifier verify-artifact ts-rule-engine-X.Y.Z.tgz \
--provenance-path ts-rule-engine-X.Y.Z.tgz.intoto.jsonl \
--source-uri github.com/ilovepixelart/ts-rule-engine \
--source-tag vX.Y.ZAll four verification paths end up at the same Fulcio-issued certificate binding the signature to the exact GitHub Actions workflow file that produced it. The split is about which tool you trust and which dependencies you have installed, not about which path is more secure.
The project runs OpenSSF Scorecard on a
weekly schedule (see .github/workflows/scorecard.yaml). The following
checks intentionally stay below their maximum score; the rationale is
documented here so future reviewers understand why they are not bugs to
chase:
-
Code-Review: Scorecard requires that recent commits be approved by a reviewer distinct from the author.ts-rule-enginehas a single active maintainer, so every change is inherently self-merged. Requiring approvals would either block all work or force self-approvals from a second account, and neither offers real review value. We rely on automated gates (CI status checks, Scorecard, SonarCloud, Biome, type checks) to catch issues instead of human review. -
Contributors: Scorecard wants contributors from 3+ distinct organizations in the last 30 commits. As a personal project this is structurally unattainable; the score will move organically if external contributors join. -
CII-Best-Practices: tracked at bestpractices.dev/projects/12515. The project targets the "passing" tier; "silver" and "gold" require multiple reviewers and documented security-review processes that are out of reach for a single-maintainer project.