-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
9.0.0 break inline base64-encoded images #774
Comments
Welcome @justrealmilk! |
This comment has been minimized.
This comment has been minimized.
ah dang okay thanks |
Glad it works for you. But note for future readers: This is unsafe! |
How do I make an exception/call the default function to make it more safe? |
Least specific to most:
How to use the default function: The default function is exposed and documented: https://github.com/remarkjs/react-markdown#defaulturltransformurl. Import it. urlTransform(url) {
if (someCondition) {
return myCustomProcessing(url)
}
return defaultUrlTransform(url)
} |
@wooorm could you provide/link to some documentation regarding why this is unsafe? I tried a few attacks where JS was embedded in image files but they didn't seem to work. |
@szszoke there are a lot of reasons why it is a bad idea. A selection of them: |
Thanks! I'm not disputing that this is an issue, I just wanted to see some concrete examples. |
Initial checklist
Affected packages and versions
9.0.0
Link to runnable example
No response
Steps to reproduce
Attempt to display
with react-markdown 8.0.7 vs 9.0.0
Expected behavior
Image should display
Actual behavior
Something bad happens resulting in the src value being lost
Runtime
Node v17
Package manager
npm 8
OS
Linux
Build and bundle tools
Next.js
The text was updated successfully, but these errors were encountered: