dev: POSIX filesystem safeguards, character escaping in URL paths #1759
danielweck
started this conversation in
Developer corner
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Potential problem:
new URL(PATH, 'file:')
vspathToFileURL(PATH)
See:
https://nodejs.org/api/url.html#urlpathtofileurlpath
...BUT! Potential cascading problem: in the Thorium codebase URLs path segments are sometimes unwrapped by simply removing the
file://
prefix, which can yield non-escaped filesystem names! (so, must think carefully before changing currently-functioning code).Relevant code references:
thorium-reader/src/renderer/library/components/catalog/AboutThoriumButton.tsx
Line 147 in 68853e6
thorium-reader/src/main/redux/sagas/api/publication/packager/packageLink.ts
Line 118 in 68853e6
thorium-reader/src/main/redux/sagas/api/publication/import/importFromString.ts
Lines 19 to 24 in 68853e6
Beta Was this translation helpful? Give feedback.
All reactions