-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: default frame renderer security improvements #506
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/render/src/ui/index.tsx
Outdated
|
||
// Don't allow SVG data URLs -- could contain malicious code | ||
if (sanitizedSrc?.startsWith("data:image/svg")) { | ||
sanitizedSrc = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanitizedSrc is not passed in as src to the img
element
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, ty
packages/render/src/ui/index.tsx
Outdated
sanitizedSrc?.startsWith("data:") && | ||
!sanitizedSrc?.startsWith("data:image") | ||
) { | ||
sanitizedSrc = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty string src is invalid afaik - might be better to throw some sort of error on the frame/display an error screen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with undefined for now. we don't have error handling at this level so will have to refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could maybe move this check to ImageContainer and render an error there or return an error component here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could maybe move this check to ImageContainer and render an error there or return an error component here
would probably be best, as silent errors is not ideal + neither is logging here
Change Summary
Failing test is unrelated to this PR
Merge Checklist