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

fix(security): encode untrusted financial UI content (ContactsView.js)

davoodmehraban89 committed Oct 31, 2026 at 00:22 UTC ad8d207967d7551ccc2aa8b39af2fdf576b4ae3d
1 file changed +5 -5
src/views/ContactsView.js
+5 -5
@@ -170,13 +170,13 @@ class ContactsViewImpl {
170 ${c.phone ? `<small style="color:var(--text-muted)">${Formatters.phone(c.phone)}</small>` : ''}
171 ${!c.mobile && !c.phone ? '—' : ''}
172 </td>
173 - <td>${c.nationalId ? Formatters.toPersianDigits(c.nationalId) : '—'}</td>
173 + <td>${this._esc(c.nationalId ? Formatters.toPersianDigits(c.nationalId) : '—')}</td>
174 <td style="font-weight:600;color:${balanceColor}">${balanceText}</td>
175 <td>
176 <div class="row-actions">
177 - <button class="icon-btn-sm" title="کارت حساب" onclick="window.ContactsView.openLedger('${c.id}')">📒</button>
178 - <button class="icon-btn-sm" title="ویرایش" onclick="window.ContactsView.editContact('${c.id}')">✏️</button>
179 - <button class="icon-btn-sm danger" title="حذف" onclick="window.ContactsView.deleteContact('${c.id}')">🗑️</button>
177 + <button class="icon-btn-sm" title="کارت حساب" onclick="window.ContactsView.openLedger(${this._esc(JSON.stringify(String(c.id ?? '')))})">📒</button>
178 + <button class="icon-btn-sm" title="ویرایش" onclick="window.ContactsView.editContact(${this._esc(JSON.stringify(String(c.id ?? '')))})">✏️</button>
179 + <button class="icon-btn-sm danger" title="حذف" onclick="window.ContactsView.deleteContact(${this._esc(JSON.stringify(String(c.id ?? '')))})">🗑️</button>
180 </div>
181 </td>
182 </tr>
@@ -346,7 +346,7 @@ class ContactsViewImpl {
346
347 const footer = `
348 <button class="btn btn-secondary" onclick="FINORA.Modal.close()">انصراف</button>
349 - <button class="btn" onclick="window.ContactsView.saveContact(${isEdit ? `'${contactId}'` : 'null'})">💾 ذخیره</button>
349 + <button class="btn" onclick="window.ContactsView.saveContact(${isEdit ? this._esc(JSON.stringify(String(contactId ?? ''))) : 'null'})">💾 ذخیره</button>
350 `;
351
352 Modal.open({