rustyscript icon indicating copy to clipboard operation
rustyscript copied to clipboard

Hide a current directory from ModuleSpecifier

Open mocchira opened this issue 10 months ago • 2 comments

Is your feature request related to a problem? Please describe. Current implementation adds a a current directory to ModuleSpecifier(s) so the current directory may appear to users executing scripts on a javascript runtime powered by rustyscript when some error occurred in v8. This leaks the internal directory structure to users so can be kind of security risk.

Describe the solution you'd like It might be good to get rid of a current directory from ModuleSpecifier(s) to mitigate the risk described above.

mocchira avatar Feb 12 '25 04:02 mocchira

Ah. Solid point.

The main issue is that deno requires an absolute path. I'll consult with them for ideas

rscarson avatar Feb 12 '25 23:02 rscarson

So I addressed this by adding hide_current_directory to Error::as_highlighted

You can use it to hide the current working dir in formatted error output

I'll leave this open till the next published release

rscarson avatar Mar 14 '25 15:03 rscarson

@rscarson when will be the next release?

mocchira avatar Jul 25 '25 03:07 mocchira

I will try to do one today, sorry

rscarson avatar Jul 25 '25 12:07 rscarson

Fixed in release 0.12.0

rscarson avatar Aug 16 '25 03:08 rscarson