فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix(security): treat confirmation messages as text rather than HTML

davoodmehraban89 committed Oct 30, 2026 at 23:57 UTC 1d8832183ccb6fb19271ffdc5e8066783e2b36c3
1 file changed +4 -1
src/core/Modal.js
+4 -1
@@ -148,12 +148,15 @@ class ModalManager {
148 }
149
150 confirm({ title, message, confirmText = 'تأیید', cancelText = 'انصراف', danger = false, onConfirm }) {
151 - const body = `<p style="font-size:13.5px;line-height:1.8">${message}</p>`;
151 + // Confirmations always render their message as text; financial record names
152 + // and externally imported labels must never become executable markup.
153 + const body = '<p data-confirm-message style="font-size:13.5px;line-height:1.8"></p>';
154 const footer = `
155 <button class="btn btn-secondary" data-action="cancel">${cancelText}</button>
156 <button class="btn ${danger ? 'btn-danger' : ''}" data-action="confirm">${confirmText}</button>
157 `;
158 const modal = this.open({ title, body, footer, size: 'sm' });
159 + modal.card.querySelector('[data-confirm-message]').textContent = String(message ?? '');
160 const footerEl = modal.card.querySelector('.modal-footer');
161 footerEl.querySelector('[data-action="cancel"]').onclick = () => this.close();
162 footerEl.querySelector('[data-action="confirm"]').onclick = () => {