TailClass scans and rewrites source code files on disk when tailclass apply or
tailclass revert is invoked. Correctness, path confinement, and deterministic
rewriting are treated seriously.
TailClass treats the scanned project, including tailclass.config.json and
tailclass.map.json, as untrusted input, because those files arrive with the
repository you clone.
- Path confinement.
outputCss,dictionaryFileandmanifestFiletaken from a configuration file must resolve inside the scanned project root; paths that escape it are rejected before anything is written or deleted. Paths supplied explicitly on the command line (--output,--dict,--report) are honoured as-is. - Physical path confinement. The root check is not merely lexical (
../): every existing component of an output path islstated and resolved withrealpathagainst the real project root. A directory symlink planted in a cloned repository can no longer redirect a write, read, backup orrevert --cleandeletion outside the project. Writes useO_NOFOLLOWand re-validate after creating parent directories. Symlinked directories whose real path stays inside the root are still allowed. - Output files must be regular files (behavior change in 1.0.2). The final
component of any output path may not be a symlink, even if the link points to a
file inside the root, even with
--force, and even for an explicit CLI path;revert --cleanlikewise never unlinks a symlink. 1.0.1 followed such links. Point the output at the real file instead. This prevents a symlink from being used to clobber, read or delete a file TailClass did not intend to touch. - No clobbering.
applyrefuses to overwrite a scanned source file, or a stylesheet/manifest that does not look like TailClass output, unless--forceis given. - No arbitrary deletion.
revert --cleandeletes only regular files TailClass can positively identify as its own (generated CSS header, or@applyrules matching an owned revert manifest). Foreign stylesheets, foreign JSON files, scanned source files, symlinks and directories are left untouched and reported viacleanupSkipped/stderr.--forcedoes not override this. - CSS payload validation. Class tokens containing
;,{,}, control characters or comment terminators are kept inline on the element and never emitted into@apply; selectors, comments and dictionary metadata are validated on output. - Bounded matching. Globs are matched with a backtracking-free algorithm, so repository-supplied patterns cannot hang the process. Symlinks are never followed out of the project.
| Version | Supported |
|---|---|
| 1.0.2+ | ✅ |
| 1.0.1 | ❌ superseded — upgrade for the v1.0.2 symlink / --clean fixes |
| 1.0.0 | ❌ superseded — upgrade for the v1.0.1 security fixes |
| < 1.0 | ❌ |
Please do not open a public issue for security problems.
Report privately through GitHub's private vulnerability reporting or by email to infinitode.ltd@gmail.com.
Please include:
- the affected TailClass version and Node.js version,
- a minimal reproduction (sample input file, config, or dictionary JSON),
- the impact you believe it has.
We aim to acknowledge reports within 5 working days and to publish a fixed release plus an advisory once a fix is available. Please give us a reasonable window to ship a fix before any public disclosure.
In scope:
- arbitrary file overwrite, deletion or path traversal outside the target project root caused by crafted configuration, dictionary or manifest files — including symlink-based traversal;
- deletion of non-TailClass files by
revert --clean; - catastrophic backtracking (ReDoS) or denial of service in the markup scanner, glob matcher, or Tailwind token parser;
- CSS injection or source corruption triggered by unsanitized dictionary values;
- supply-chain issues in the repository's build or release workflows.
Out of scope:
- vulnerabilities in Node.js, Tailwind CSS, or PostCSS themselves (please report those upstream);
- styling differences introduced when a user manually edits generated
@applyrules after extraction.