mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-28 15:45:22 -04:00
fix(ui): escape model name in model-info popup (DOM-XSS) + two latent sinks (#4605)
chatRenderer.js built the model-info popup HTML by concatenating the model name (from the LLM response's model/answered_by field) into popup.innerHTML without escaping, so a model advertised as an HTML/script payload executed when the user clicked the role label. Wrap both insertions with the uiModule.esc() helper the same function already uses. Also apply existing escape helpers at two latent sinks flagged by CodeQL, fed only by self-authored/server values today: document-tab title via _esc(), and the calendar event background URL (escape the double quote that would otherwise break out of the style="..." attribute).
This commit is contained in:
@@ -284,8 +284,8 @@ import * as Modals from './modalManager.js';
|
||||
? langIcon(doc.language, 12, { style: 'opacity:0.65;flex-shrink:0;color:currentColor;margin-right:4px;' })
|
||||
: '';
|
||||
const langChip = `<span class="doc-tab-lang">${lic}</span>`;
|
||||
html += `<div class="doc-tab${isActive ? ' active' : ''}" draggable="true" data-doc-id="${id}" title="${title}">
|
||||
${verChip}${langChip}<span class="doc-tab-title">${shortTitle}</span>
|
||||
html += `<div class="doc-tab${isActive ? ' active' : ''}" draggable="true" data-doc-id="${id}" title="${_esc(title)}">
|
||||
${verChip}${langChip}<span class="doc-tab-title">${_esc(shortTitle)}</span>
|
||||
<button class="doc-tab-close" data-doc-id="${id}" title="Unlink from chat (kept in the Library)">×</button>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user