Skip to content
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

Consideration for unicode bidirectional markers? #39

Open
benj-dobs opened this issue Oct 19, 2023 · 1 comment
Open

Consideration for unicode bidirectional markers? #39

benj-dobs opened this issue Oct 19, 2023 · 1 comment

Comments

@benj-dobs
Copy link

At the moment, filenamify does not filter out unicode bidi characters such as U+202E RIGHT-TO-LEFT-OVERRIDE. There is some concern that these could be used to construct malicious but innocent-looking filenames:

bar [U+202e]cod.bat
becomes:
bar ‮‮cod.bat

My feeling is that this library should strip these characters, but I'm not 100% certain.

@sindresorhus
Copy link
Owner

I agree, we should strip all non-printable characters.

In addition, we should normalize all whitespace (including Unicode whitespace) to a single space.

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

No branches or pull requests

2 participants