Skip to content

Commit

Permalink
EW-793 Prevent script injection
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneRadtke-Cap committed Jun 6, 2024
1 parent 02bffc4 commit 985a88f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export class CommonCartridgeExportMapper {

private getTextTitle(text: string): string {
let title = text.slice(0, 50).replace(/<[^>]*>?/gm, '');

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization High

This string may still contain
<script
, which may cause an HTML element injection vulnerability.
title = title.replace(/<script/gi, '&lt;script');
if (text.length > 50) {
title = title.concat('...');
}
Expand Down

0 comments on commit 985a88f

Please sign in to comment.