News for hackers. Stuff that matters.
Re:PHP in 2020 by mustardo on Wednesday January 22, 2020 @05:33AM (#22116252)
`<?= $_GET['theVarName'] ?>`

Is vulnerable to XSS

This I assume is another reason why HTML "aware" templating engines are now popular in PHP rather than toggling with <? and ?> between HTML and PHP

PHP makes it really easy (IMHO) to write insecure code, and most samples you find online are. Not many people starting with PHP learn

`<?= htmlspecialchars($_GET["theVarName"]) ?>`

or equivalent.

Re:PHP in 2020 by mszcz on Wednesday January 22, 2020 @06:28AM (#22116574)
Well, any language that has the capacity to take raw user input and output it as-is is "vulnerable to XSS" so... ;)