Insecure run command on Fresh homepage
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- deno, typescript
Research direction
The issue points to the Fresh homepage and possibly the docs, but names no repository files or tests. Start by locating where the deno run -Ar jsr:@fresh/init command is documented and review Deno’s permission flags. Done means the setup instructions limit permissions to what initialization requires and explain any necessary access.
Written by the indexing model from the issue text.
Description
The fresh homepage, and possibly the docs too, show a short and easy-to-run command to set up Fresh: deno run -Ar jsr:@fresh/init.
This command uses -A (--allow-all) and -r(--reload), making it download code from the internet and executing it with full user permissions.
Deno also provides a
--allow-allflag that grants all permissions to the script. This disables the security sandbox entirely, and should be used with caution. The--allow-allhas the same security properties as running a script in Node.js (ie none).
https://docs.deno.com/runtime/fundamentals/security/
This widens the blast radius of a supply-chain attack: with --allow-all, any transitive dependency of @fresh/init executes with full system permissions instead of being sandboxed.
The same effect can be achieved with
deno run --allow-net=jsr.io,usefresh.dev,fresh.deno.dev --allow-run=deno -RWr jsr:@fresh/init
The biggest concern I have with the above command is --allow-run=deno that still allows the package to run a deno command with any flag it wants. It is currently used for deno install, maybe the user can do that themselves?
You probably don't ever want to use --allow-run=deno unless the parent process has --allow-all, as being able to spawn a deno process means the script can spawn another deno process with full permissions.
https://docs.deno.com/runtime/fundamentals/security/#subprocesses
The -RW flag allows reading & writing. Possible too permissive as well, but added for convenience since the alternative is requiring defining the destination folder in the command.
Limiting the network locations Deno can access is a good first start and shrinks the attack vector possibilities greatly.
- Dominant language
- TypeScript
- Stars
- 13.8k
- Forks
- 757
- Avg merge
- 3m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from freshframework/fresh
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freshframework/fresh#3920 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
freshframework/fresh#3833 ·
-
feat
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
freshframework/fresh#3803 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
freshframework/fresh#3918 · 1 comment · 4 reactions ·
-
Tab title doesn't update to <Head> <title> when navigating to a page with another <title>Possibly taken @1AbdullahButt claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 57/100
freshframework/fresh#3916 ·
All issues in freshframework/fresh
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tintinweb/pi-subagents#459 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
danielmiessler/LifeOS#2830 ·
Maintainers usually reply within 6 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: client enhancement priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
opensro-dev/opensro#3681 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day