Description
The Leads page dynamically renders CSV import history and row-level import errors using innerHTML.
While frontend/leads.html already provides an escapeHtml() utility and uses it when rendering lead fields, some values in the CSV import UI are inserted into generated HTML without escaping.
For example, renderImportErrorRows() renders values such as:
and renderImportHistory() renders values such as:
directly into HTML templates.
If any of these values contain unexpected HTML markup, they may be interpreted by the browser instead of displayed as plain text.
Proposed Solution
Ensure all dynamic/import-derived text rendered through innerHTML is safely escaped before insertion.
Where possible:
- Use the existing
escapeHtml() helper for dynamic text values.
- Consider using
textContent when HTML generation is not required.
- Audit the CSV import history/error rendering functions for similar unsafe interpolation.
- Preserve the existing UI and functionality.
Files to Modify
Acceptance Criteria
Contribution Request
Hi @Kuldeeep18
I would like to work on this issue as a GSSoC '26 contributor. Please assign this issue to me if it aligns with the project's contribution guidelines.
I will ensure the implementation follows the existing code style and does not introduce regressions.
Description
The Leads page dynamically renders CSV import history and row-level import errors using
innerHTML.While
frontend/leads.htmlalready provides anescapeHtml()utility and uses it when rendering lead fields, some values in the CSV import UI are inserted into generated HTML without escaping.For example,
renderImportErrorRows()renders values such as:entry.emailentry.errorand
renderImportHistory()renders values such as:job.filenamedirectly into HTML templates.
If any of these values contain unexpected HTML markup, they may be interpreted by the browser instead of displayed as plain text.
Proposed Solution
Ensure all dynamic/import-derived text rendered through
innerHTMLis safely escaped before insertion.Where possible:
escapeHtml()helper for dynamic text values.textContentwhen HTML generation is not required.Files to Modify
frontend/leads.htmlAcceptance Criteria
innerHTML.<,>,&,", and'display correctly.Contribution Request
Hi @Kuldeeep18
I would like to work on this issue as a GSSoC '26 contributor. Please assign this issue to me if it aligns with the project's contribution guidelines.
I will ensure the implementation follows the existing code style and does not introduce regressions.