SIGN IN SIGN UP

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

0 0 168 TypeScript

Potential fix for code scanning alert no. 11: DOM text reinterpreted as HTML (#3497)

Potential fix for
[https://github.com/Stirling-Tools/Stirling-PDF/security/code-scanning/11](https://github.com/Stirling-Tools/Stirling-PDF/security/code-scanning/11)

To fix the issue, we should avoid using `innerHTML` to insert untrusted
data into the DOM. Instead, we can use DOM manipulation methods like
`createElement` and `appendChild` to construct the required HTML
structure safely. These methods do not interpret strings as HTML,
thereby mitigating the risk of XSS.

Specifically:
1. Replace the `innerHTML` assignment on line 302 with code that creates
the required DOM elements programmatically.
2. Ensure that the `selectedOperation` value is inserted as plain text
using `textContent` or equivalent methods.

---


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
A
Anthony Stirling committed
1bb3b68a87c8bae1b5c76c8c43e7879b703c6af1
Parent: e0c06ec
Committed by GitHub <noreply@github.com> on 5/9/2025, 5:53:13 PM