@@ -327,7 +327,7 @@ XSS.InjectionChecker = (async () => {
327327 _assignmentRx : / ^ (?: [ ^ ( ) = " ' \s ] + = (?: [ ^ ( = ' " \[ + ] + | [ ? a - z A - Z _ 0 - 9 ; , & = / ] + | [ \d . | ] + ) ) $ / ,
328328 _badRightHandRx : / = [ \s \S ] * (?: _ Q S _ \b | [ | . ] [ \s \S ] * s o u r c e \b | < [ \s \S ] * \/ [ ^ > ] * > ) / ,
329329 _wikiParensRx : / ^ (?: [ \w . | - ] + \/ ) * \( * [ \w \s - ] + \( [ \w \s - ] + \) [ \w \s - ] * \) * $ / ,
330- _neutralDotsRx : / (?: ^ | [ \/ ; & # ] ) [ \w - ] + \. [ \w - ] + [ \? ; \& # ] / g,
330+ _neutralDotsOrParensRx : / (?: ^ | [ \/ ; & # ] ) (?: [ \w - ] + \. [ \w - ] + [ \? ; \& # ] | [ \s \d ] * \( ) / g,
331331 _openIdRx : / ^ s c o p e = (?: \w + \+ ) \w / , // OpenID authentication scope parameter, see http://forums.informaction.com/viewtopic.php?p=69851#p69851
332332 _gmxRx : / \$ \( c l i e n t N a m e \) - \$ \( d a t a C e n t e r \) \. ( \w + \. ) + \w + / , // GMX webmail, see http://forums.informaction.com/viewtopic.php?p=69700#p69700
333333
@@ -354,7 +354,7 @@ XSS.InjectionChecker = (async () => {
354354 return this . _singleAssignmentRx . test ( expr ) || this . _riskyAssignmentRx . test ( expr ) && this . _nameRx . test ( expr ) ;
355355
356356 return this . _riskyParensRx . test ( expr ) ||
357- this . _maybeJSRx . test ( expr . replace ( this . _neutralDotsRx , '' ) ) &&
357+ this . _maybeJSRx . test ( expr . replace ( this . _neutralDotsOrParensRx , '' ) ) &&
358358 ! this . _wikiParensRx . test ( expr ) ;
359359
360360 } ,
@@ -457,7 +457,7 @@ XSS.InjectionChecker = (async () => {
457457 checkLastFunction : function ( ) {
458458 var fn = this . syntax . lastFunction ;
459459 if ( ! fn ) return false ;
460- var m = fn . toSource ( ) . match ( / \{ ( [ \s \S ] * ) \} / ) ;
460+ var m = fn . toString ( ) . match ( / \{ ( [ \s \S ] * ) \} / ) ;
461461 if ( ! m ) return false ;
462462 var expr = this . stripLiteralsAndComments ( m [ 1 ] ) ;
463463 return / = [ \s \S ] * c o o k i e | \b (?: s e t t e r | d o c u m e n t | l o c a t i o n | (?: i n n | o u t ) e r H T M L | \. \W * s r c ) [ \s \S ] * = | [ \w $ \u0080 - \uffff \) \] ] \s * [ \[ \( ] / . test ( expr ) ||
@@ -778,7 +778,7 @@ XSS.InjectionChecker = (async () => {
778778 if ( ret ) {
779779 let msg = "JavaScript Injection in " + s ;
780780 if ( this . syntax . lastFunction ) {
781- msg += "\n" + this . syntax . lastFunction . toSource ( ) ;
781+ msg += `\n ${ this . syntax . lastFunction } ` ;
782782 }
783783 this . escalate ( msg ) ;
784784 }
0 commit comments