Skip to content

Rearchitecture for v0.4.0 - #197

Merged
DecDuck merged 28 commits into
developfrom
redistributable
Nov 9, 2025
Merged

DecDuck merged 28 commits into
developfrom
redistributable

Conversation

@DecDuck

@DecDuck DecDuck commented Aug 20, 2025

Copy link
Copy Markdown
Member

No description provided.

@DecDuck DecDuck changed the title Redistributable support Rearchitecture for v0.4.0 Aug 20, 2025
@DecDuck

DecDuck commented Aug 20, 2025 •

Copy link
Copy Markdown
Member Author

New database-level support for:

  • Games
  • Mods
  • Addons DLCs
  • Redistributables

Each one of these can have multiple versions, each containing:

  • Platform
  • droplet manifest

And then they can specialize with another table, which contains additional metadata.

For the GameVersion table, it now stores launch commands as an array/another table of entries, adding #180

Comment thread components/Import/Redist.vue Fixed
const svgContent = await file.text();
const parser = new DOMParser();
try {
const document = parser.parseFromString(svgContent, "image/svg+xml");

Check warning

Code scanning / CodeQL

DOM text reinterpreted as HTML Medium

DOM text
is reinterpreted as HTML without escaping meta-characters.

Copilot Autofix

AI about 1 year ago

To fix the vulnerability, the code should sanitize the SVG content before storing or rendering it. This means stripping out potential scripts, event handlers, and other risky elements from the user-provided SVG string before setting it as platform.value.icon. The best way to do this in a Vue context is to use a well-known, dedicated sanitization library such as DOMPurify, which is robust, easy to use, and widely accepted for sanitizing HTML/SVG. The fix should import DOMPurify, sanitize the extracted SVG using DOMPurify.sanitize, and then store the sanitized version. This change should be made in the region of the addSvg method where the value is assigned.

Edits:

  • Add import for DOMPurify.
  • Use DOMPurify.sanitize(svg.outerHTML, { USE_PROFILES: { svg: true } }) before assigning to platform.value.icon (see DOMPurify docs for SVG handling).
    No other functionality should be changed.

Suggested changeset 2
app/components/Import/Redist.vue

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/app/components/Import/Redist.vue b/app/components/Import/Redist.vue
--- a/app/components/Import/Redist.vue
+++ b/app/components/Import/Redist.vue
@@ -1,4 +1,6 @@
 <!-- eslint-disable vue/no-v-html -->
+<script setup>
+import DOMPurify from 'dompurify';
 <template>
   <div class="flex flex-row gap-x-4">
     <label
@@ -289,7 +291,7 @@
     if (!svg) throw "No SVG in uploaded image.";
     svg.removeAttribute("width");
     svg.removeAttribute("height");
-    platform.value.icon = svg.outerHTML;
+    platform.value.icon = DOMPurify.sanitize(svg.outerHTML, { USE_PROFILES: { svg: true } });
   } catch (e) {
     createModal(
       ModalType.Notification,
EOF
@@ -1,4 +1,6 @@
<!-- eslint-disable vue/no-v-html -->
<script setup>
import DOMPurify from 'dompurify';
<template>
<div class="flex flex-row gap-x-4">
<label
@@ -289,7 +291,7 @@
if (!svg) throw "No SVG in uploaded image.";
svg.removeAttribute("width");
svg.removeAttribute("height");
platform.value.icon = svg.outerHTML;
platform.value.icon = DOMPurify.sanitize(svg.outerHTML, { USE_PROFILES: { svg: true } });
} catch (e) {
createModal(
ModalType.Notification,
package.json
Outside changed files

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/package.json b/package.json
--- a/package.json
+++ b/package.json
@@ -58,7 +58,8 @@
     "vue-router": "latest",
     "vue3-carousel": "^0.16.0",
     "vue3-carousel-nuxt": "^1.1.5",
-    "vuedraggable": "^4.1.0"
+    "vuedraggable": "^4.1.0",
+    "dompurify": "^3.3.0"
   },
   "devDependencies": {
     "@intlify/eslint-plugin-vue-i18n": "^4.0.1",
EOF
@@ -58,7 +58,8 @@
"vue-router": "latest",
"vue3-carousel": "^0.16.0",
"vue3-carousel-nuxt": "^1.1.5",
"vuedraggable": "^4.1.0"
"vuedraggable": "^4.1.0",
"dompurify": "^3.3.0"
},
"devDependencies": {
"@intlify/eslint-plugin-vue-i18n": "^4.0.1",
This fix introduces these dependencies
Package Version Security advisories
dompurify (npm) 3.3.0 None
Copilot is powered by AI and may make mistakes. Always verify output.
@DecDuck
DecDuck marked this pull request as ready for review October 29, 2025 09:53
@DecDuck

DecDuck commented Oct 29, 2025

Copy link
Copy Markdown
Member Author

TODO list for this PR:

  • import page for redistributables
  • actual metadata page for redistributables
  • edit modal for versions

Features:

  • redistributables
  • updates to import UI
  • update to nuxt 4

@DecDuck
DecDuck merged commit 251ddb8 into develop Nov 9, 2025
2 of 5 checks passed
@DecDuck
DecDuck deleted the redistributable branch November 9, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants