Skip to content

feat: Deno.cwd() no longer requires --allow-read permission #27192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 27, 2025

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Dec 2, 2024

This commit changes "Deno.cwd()" (as well as "process.cwd()") to no longer
require full "--allow-read" permission. This change was meant to be done
in Deno 2.0.0, but somehow it slipped. Requiring full read permission just to
read the CWD is a mistake, because CWD can already be obtained
with no permission by throwing an error in JS and inspecting its stack.

Fixes #27110

@bartlomieju
Copy link
Member

I think we should merge it in a minor release maybe?

@dsherret dsherret added this to the 2.2.0 milestone Dec 4, 2024
@bartlomieju bartlomieju self-assigned this Jan 21, 2025
@bartlomieju bartlomieju changed the title fix: remove permission check for CWD feat: Deno.cwd() no longer requires --allow-read permission Jan 26, 2025
@bartlomieju bartlomieju requested a review from dsherret January 26, 2025 21:43
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bartlomieju bartlomieju merged commit 4e655e5 into main Jan 27, 2025
17 checks passed
@bartlomieju bartlomieju deleted the remove-cwd-permission branch January 27, 2025 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Deno.cwd() permission check
3 participants