@@ -209,6 +209,33 @@ to JavaScript, Deno uses the file system as a cache. This means that file system
209209resources like storage space can be consumed by Deno even if the user has not
210210explicitly granted read/write permissions.
211211
212+ #### Symbolic links
213+
214+ When reading or writing through a symbolic link, Deno checks permissions based
215+ on the symlink's location, not the target it points to. This means if you have
216+ ` --allow-read=/app ` , you can read through a symlink at ` /app/link ` even if it
217+ points to a file outside ` /app ` .
218+
219+ However, Deno prevents privilege escalation through symlinks. If a symlink
220+ resolves to a sensitive system path, additional permissions are required:
221+
222+ - ** ` /proc ` , ` /dev ` , ` /sys ` (Linux)** : Reading or writing through symlinks that
223+ resolve to these paths requires ` --allow-all ` , as these paths can expose
224+ sensitive system information.
225+ - ** ` /proc/**/environ ` ** : Requires ` --allow-env ` since it exposes environment
226+ variables.
227+ - ** ` /dev/null ` , ` /dev/zero ` , ` /dev/random ` , ` /dev/urandom ` ** : These safe device
228+ files are always accessible without additional permissions.
229+
230+ Creating symlinks with ` Deno.symlink() ` requires both ` --allow-read ` and
231+ ` --allow-write ` with full access (not path-specific), because symlinks can point
232+ to arbitrary locations.
233+
234+ > ** Note** : Symlinks that already exist on the filesystem can be read through
235+ > using the permissions for the symlink's location. The full read/write
236+ > permission requirement only applies to _ creating_ new symlinks with
237+ > ` Deno.symlink() ` .
238+
212239### Network access
213240
214241By default, executing code can not make network requests, open network listeners
0 commit comments