Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions runtime/fundamentals/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,33 @@ to JavaScript, Deno uses the file system as a cache. This means that file system
resources like storage space can be consumed by Deno even if the user has not
explicitly granted read/write permissions.

#### Symbolic links

When reading or writing through a symbolic link, Deno checks permissions based
on the symlink's location, not the target it points to. This means if you have
`--allow-read=/app`, you can read through a symlink at `/app/link` even if it
points to a file outside `/app`.

However, Deno prevents privilege escalation through symlinks. If a symlink
resolves to a sensitive system path, additional permissions are required:

- **`/proc`, `/dev`, `/sys` (Linux)**: Reading or writing through symlinks that
resolve to these paths requires `--allow-all`, as these paths can expose
sensitive system information.
- **`/proc/**/environ`**: Requires `--allow-env` since it exposes environment
variables.
- **`/dev/null`, `/dev/zero`, `/dev/random`, `/dev/urandom`**: These safe device
files are always accessible without additional permissions.

Creating symlinks with `Deno.symlink()` requires both `--allow-read` and
`--allow-write` with full access (not path-specific), because symlinks can point
to arbitrary locations.

> **Note**: Symlinks that already exist on the filesystem can be read through
> using the permissions for the symlink's location. The full read/write
> permission requirement only applies to _creating_ new symlinks with
> `Deno.symlink()`.

### Network access

By default, executing code can not make network requests, open network listeners
Expand Down