Scan your whole stack
Are you using @effected/files?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.4.0
@effected/files was last scanned on 28 Nov 2026 at version 0.4.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.4.0 LATEST | 28 Nov 2026 | No rules fired |
| 0.3.0 | 10 Nov 2026 | No rules fired |
| 0.1.0 | 5 Nov 2026 | No rules fired |
| 0.0.0-stage | 5 Nov 2026 | Not shown |
Findings for v0.4.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.4.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Atomic file and directory writes for Effect. AtomicFile.write: refuse a target the caller may not write, then write a temp file beside it, sync it, and rename it into place, so a crash never leaves a truncated file. A symlinked target is followed by default, or replaced with { links: "replace" }. When following, a link realPath cannot follow is the one exception: it is written through directly. AtomicDirectory.write replaces a whole directory so a reader sees the old tree or the new one.
Pre-
1.0.0. This package is part of the@effected/*kit, still in0.xdevelopment.Stability: unstable. This package's API surface is not yet considered complete and may change across
0.xreleases. Pin an exact version. Full policy: release strategy.
A plain write truncates the file first. A crash or a kill during the write leaves the user with a short or empty file. The fix is a temp file and a rename, which looks like three lines, and those three lines replace a symlink with a regular file, reset the file's permissions, and overflow the name limit on a long file name. This package is that write done once.
npm install @effected/files effect
pnpm add @effected/files effect
Requires Node.js >=24.11.0. effect is a peer dependency. ESM-only: import it from an ES module.
import { AtomicFile } from "@effected/files";
// Effect<void, PlatformError, FileSystem.FileSystem | Path.Path>
const save = AtomicFile.write("/home/me/.config/tool/config.json", '{"theme":"dark"}\n');
{ links: "replace" } to replace the link itself instead (see below).NotFound.AtomicFile.write(target, content, options?) takes links, which decides what a symbolic link at target itself means:
import { AtomicFile } from "@effected/files";
// The default: write the file the link points to, and keep the link.
yield* AtomicFile.write("/home/me/.zshrc", text);
// Replace the link with a regular file, leaving whatever it pointed to alone.
yield* AtomicFile.write("/repo/.config/tool.json", text, { links: "replace" });
target is |
links: "follow" (default) |
links: "replace" |
|---|---|---|
| a link to an existing file | that file is replaced atomically; the link stays | the link is replaced atomically by a regular file; the file it pointed to is not read, checked or written |
| a dangling link | the file is created where the link points, written directly without atomicity; the link stays | the link is replaced atomically; nothing is created where it pointed |
| a regular file or absent | replaced or created atomically | the same |
Under "replace" the temp file is created in the link's own directory, and the link's destination contributes no permission bits and no access check: the new file is a fresh file. "follow" is the default because keeping a link is right for a dotfile a user links in on purpose. Any other value of links is a defect.
Either way only the last component of target is governed. A symlinked parent directory is traversed, as with any path, so /repo/sub/config.json with sub linked elsewhere lands elsewhere in both modes. When the parents are not trusted either, check the target with @effected/walker's confineReal before writing.
A tool that writes into a repository can be pointed outside it by a symlink committed to that repository. Under "follow", a committed config.json -> /home/me/.ssh/authorized_keys makes a mutating command overwrite the outside file, and a dangling one makes it create a file outside. The random .effected-*.tmp temp name, opened with wx, closes the related attack of planting a link at a predictable temp name, so a consumer gains nothing by hand-rolling a fixed-name temp and rename.
The severity is low. The attacker needs a committed symlink and someone running a mutating command in that checkout, where pnpm install would already run the checkout's own code. It matters most for agent-driven tools and long-running servers acting on a checkout nobody has reviewed. Pass { links: "replace" } to AtomicFile.write there, and confine the path when its parent directories are not trusted either.
The kit's own writers built on AtomicFile.write all follow links, and none of them takes a links option yet:
| Writer | Package | Links |
|---|---|---|
PackageJsonFile writes |
@effected/package-json |
follow |
ConfigFile writes |
@effected/config-file |
follow |
ManagedSection writes |
@effected/templates |
follow |
SchemaFile writes |
@effected/schemastore |
follow |
effected schema build output |
@effected/engine |
follow |
Passing the option through each writer is a follow-up. Until then, a tool that must not follow links into an untrusted checkout writes through AtomicFile.write with { links: "replace" } itself, or confines the path first.
AtomicDirectory.write never writes through a symlinked root. A link to a directory is renamed aside and removed, so the new tree takes its place and the tree it pointed to is left alone. A dangling link fails with operation promote and creates nothing where it points. Symlinked parent directories of root are traversed.
AtomicDirectory.write(root, files) replaces the directory at root with exactly files (any iterable of relative path and content pairs: a Map, tuples, Object.entries(record)), so a reader sees the old tree or the new one and never a partial write. It needs FileSystem and Path from your platform layer:
import { AtomicDirectory } from "@effected/files";
yield* AtomicDirectory.write("/var/cache/app/left-pad", new Map([["package.json", "{}"], ["lib/index.d.ts", "export {};"]]));
It stages in the sibling .<name>.staging (same parent, so every rename stays on one filesystem and is atomic), clears leftover .<name>.staging and .<name>.old siblings from a crashed run first, creates staging even for an empty set, and writes every file with its parent directories. It then renames the live directory to .<name>.old, renames staging into place, and removes .<name>.old, so the old tree is only deleted once no reader can reach it. Both siblings belong to the writer and are removed with force. Two things to design around:
root does not exist. A reader in that window sees a missing directory, never a partial one, so treat absence as a miss. A crash inside the window leaves root absent with the old tree whole in .<name>.old and the new one whole in staging; the next call recovers.root.root is normalised first, and one whose basename is . or .. is refused, as is a file path that is empty, absolute or climbs out of the directory, all before anything is touched. Failures are AtomicDirectoryError, which carries an operation of validate, clear, stage, write, promote or cleanup, the path it was working on and the structural cause. A write failure leaves the live tree untouched; a promote failure can leave it absent, and the next call recovers; a cleanup failure means the new tree is live and only the old one is left over.
PermissionDenied before any temp is created, as a plain write would. The check asks the platform, so root bypasses it, as it does a plain write..effected-*.tmp file beside the target.links: "follow", a link realPath cannot follow (dangling, or with a symlink before .. in its text under Node) is written through directly, without atomicity. links: "replace" has no such case.MIT
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.