Failing to properly encode user-controlled values in file entities, the ShowImageController
(eID txcmsshowpic) is vulnerable to cross-site scripting. Exploiting this vulnerability requires a valid backend user account with access to file entities.
Update to TYPO3 versions 9.5.48 ELTS, 10.4.45 ELTS, 11.5.37 LTS, 12.4.15 LTS, 13.1.1 that fix the problem described.
Thanks to TYPO3 security team member Torben Hansen who reported this issue and to TYPO3 core & security team member Oliver Hader who fixed the issue.