Skip to content

Commit

Permalink
More fixes for slug sanitization
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Sep 13, 2024
1 parent be8e86d commit b4b5752
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/js/jquery.pods.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,9 @@
if ( $slug.length ) {
$slug.on( 'change', function () {
// Strip HTML/code.
var slug = $( this ).val().replace( /<(?:.)*?>/g, '' ),
var slug = $( this ).val().replace( /<(?:.)*?>/g, '' ).replace( /['"]/g, '' ).replace( /<!--|--!?>/g, '' ).replace( /<|>/g, '' ),

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization High

This string may still contain
<!--
, which may cause an HTML element injection vulnerability.

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization High

This string may still contain
<script
, which may cause an HTML element injection vulnerability.
nameRaw = $( this ).prop( 'name' ),
name = nameRaw.replace( '[', '\\[' ).replace( ']', '\\]' );
name = nameRaw.replace( /\[/g, '\\[' ).replace( /\]/g, '\\]' );

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

if ( slug.length ) {
slug = slug.replace( /_+/g, '_' );
Expand Down

0 comments on commit b4b5752

Please sign in to comment.