Skip to content

Taint detection does not work for encapsulated strings (echo "$unsafe";) #3655

@TysonAndre

Description

@TysonAndre

Observed: No TaintedInput is emitted, but it would be emitted if the quotes are removed
Expected: TaintedInput is emitted

$pdo->exec("select * from users where name='" . $name . "'") in https://psalm.dev/docs/security_analysis/ suggests taint detection already works for concatenation but not encapsulation

<?php

$unsafe = $_GET['unsafe'];
echo "$unsafe";

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions