π Fix Insecure LocalStorage Usage#6
Conversation
Migrated application state storage for projects and floating panel positions from `localStorage` to IndexedDB using the `idb-keyval` library. Added logic to seamlessly migrate existing user data from `localStorage` over to IndexedDB upon first launch, and safely clean up the legacy `localStorage` keys. Co-authored-by: artistso <290508482+artistso@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π― What: The vulnerability fixed was insecure local storage usage, which could expose sensitive data in a cross-site scripting (XSS) attack and ran into browser quota limitations for large drawing projects.
β οΈ Risk: While the impact is lower in a drawing application, storing potentially large sets of user-generated data or settings in LocalStorage presents a security weakness. It leaves user data vulnerable to theft if an XSS vulnerability were to be introduced elsewhere in the application, and the size limitations often cause unexpected bugs.
π‘οΈ Solution: Swapped
localStorageusage with IndexedDB via the lightweightidb-keyvaldependency. IndexedDB provides a more secure, modern web storage API that supports asynchronous interaction and handles larger amounts of data without hitting the tight quotas of LocalStorage. I've also implemented backward-compatibility logic to seamlessly migrate user data from LocalStorage to IndexedDB on their next visit, ensuring no data loss.PR created automatically by Jules for task 6470512226870728574 started by @artistso