You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deno.bundle() takes in as argument a file name as a string. If the file is of a supported media type (currently javascript, JSX, Typescript, TSX, Json or Wasm), it will bundle that file up and return the output to the calling module as a string of Javascript. No permissions are required. This effectively gives the calling module the ability to read the contents of any these media types located anywhere on the file system without requiring any permission.
Compile file:///deno/module/dir/bundle_poc.ts// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.// This is a specialised implementation of a System module loader.// @ts-nocheck/* eslint-disable */letSystem,__inst,__inst_s;<...trimmedoutput...>{"my_secret_API_key": "abcd1234"}
__inst_s("secrets");
As demonstrated above, this method exposes the json data to the calling module. If Deno.bundle() can access any of these media types on the file system and allow the content to be accessed in the module, it should be required to run under the --allow-read permission.
The text was updated successfully, but these errors were encountered:
This isn't specific to Deno.bundle()... We currently allow importing of JSON without permissions full stop. Deno.bundle() uses the same infrastructure.
I think this issue is no longer valid - any runtime API (import(), Deno.compile(), Deno.bundle(), Deno.transpileOnly()) does permission check before loading files. Additionally neither WASM nor JSON imports are supported anymore (past v1.0.0)
Deno.bundle() takes in as argument a file name as a string. If the file is of a supported media type (currently javascript, JSX, Typescript, TSX, Json or Wasm), it will bundle that file up and return the output to the calling module as a string of Javascript. No permissions are required. This effectively gives the calling module the ability to read the contents of any these media types located anywhere on the file system without requiring any permission.
Proof of concept
/some/other/dir/secrets.json
/deno/module/dir/bundle_poc.ts
when executed as:
deno bundle_poc.ts
The output (trimmed) is:
As demonstrated above, this method exposes the json data to the calling module. If Deno.bundle() can access any of these media types on the file system and allow the content to be accessed in the module, it should be required to run under the
--allow-read
permission.The text was updated successfully, but these errors were encountered: