Skip to content

(docs) The php example for response is not xss safe #32

Description

@alexlehm

The php example on the docs page uses a pattern that is not xss safe, while this may not be directly exploitable if the report script is setting the correct content-type, it is still a good practice to provide safe examples (it might be exploitable if the content-type is text/html).

jsErrLog.removeScript(<?=$_GET['i']?>);

at least requires a regex check to avoid xss

<?
$i=$_GET['i'];
if(preg_match('/^[0-9]+$/',$i)===FALSE) [
  $i=0;
}
?>
jsErrLog.removeScript(<?=$i?>);

(I hope I got the script correct, typed this from memory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions