MEDIUM: Missing error handling for canvas.toDataURL (SecurityError risk) #5
Labels
No labels
blocked:lint-failed
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:pre-dispatch
bug
feature-request
in-progress
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/tokengenerator#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
Location
tokengenerator.html, lines 381-388:Description
canvas.toDataURL()throws aSecurityErrorif the canvas has been "tainted" by drawing cross-origin images (e.g., through the AI-generated icon loaded from a data URI or if third-party content is drawn). There is no try/catch around this call.If the canvas is tainted, the download silently fails with a JavaScript error in console, and no feedback is given to the user.
Recommended Fix
toDataURL()in a try/catch block.canvas.toBlob()with proper error handling as an alternative.Impact
Users may attempt to download tokens but get a silent failure with no feedback.