There is not really a problem with the existing pattern, I would just like to propose a new instance for that pattern.
The null coalescing operator in php can also be used in combination with '=', this null coalescing assignment operator was introduced in PHP 7.4 (source).
I think it might be interesting to see, if the SAST tool is able to recognize this.
Proposed changes
Introduce instance 3 with the following PHP code:
$a = $_GET["p1"]; // source
$b = null;
$b ??= $a; //tarpit: $b assigned to $a as the 1st param of coalescing is null
echo $b; // sink
Other
The discovery rule can be the same, as for the other two instances.
Testability pattern
6_coalesce
Problem statement
There is not really a problem with the existing pattern, I would just like to propose a new instance for that pattern. The null coalescing operator in php can also be used in combination with '=', this null coalescing assignment operator was introduced in PHP 7.4 (source). I think it might be interesting to see, if the SAST tool is able to recognize this.
Proposed changes
Introduce instance 3 with the following PHP code:
Other
The discovery rule can be the same, as for the other two instances.