Tuleap 16 est là ! Assistez à l'événement virtuel le 17 octobre à 10h30. Inscrivez-vous ici !

    •  
      request #27184 Psalm taint analysis complains about tainted HTML in LDAP CLI tool
    Infos
    #27184
    Thomas Gerbet (tgerbet)
    2022-06-17 15:33
    2022-06-17 09:09
    28731
    Details
    Psalm taint analysis complains about tainted HTML in LDAP CLI tool

    New issue is spotted by Psalm likely thanks to another change in the codebase helping the analysis.

    The error is accurate but this is not not something we care about in this context: this is a (quite ugly) CLI tool.

    ERROR: TaintedHtml - plugins/ldap/bin/registerUser.php:80:22 - Detected tainted HTML (see https://psalm.dev/245)
    
      HTTPRequest::get - src/common/include/Codendi_Request.class.php:65:21
    
        public function get($variable)
    
    
      call to PFUser::setStatus - src/www/admin/usergroup.php:194:42
    
                            $user->setStatus($request->get('form_status'));
    
    
      PFUser::setStatus#1 - src/common/User/User.class.php:1092:31
    
        public function setStatus($status)
    
    
      $status - src/common/User/User.class.php:1092:31
    
        public function setStatus($status)
    
    
      $this->status - src/common/User/User.class.php:1100:13
    
                $this->status = $status;
    
    
      PFUser::$status
    
        <no known location>
    
    
      $this->status - src/common/User/User.class.php:664:16
    
            return $this->status;
    
    
      PFUser::getStatus - src/common/User/User.class.php:662:21
    
        public function getStatus()
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      call to echo - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
    
    
    ERROR: TaintedTextWithQuotes - plugins/ldap/bin/registerUser.php:80:22 - Detected tainted text with possible quotes (see https://psalm.dev/274)
    
      HTTPRequest::get - src/common/include/Codendi_Request.class.php:65:21
    
        public function get($variable)
    
    
      call to PFUser::setStatus - src/www/admin/usergroup.php:194:42
    
                            $user->setStatus($request->get('form_status'));
    
    
      PFUser::setStatus#1 - src/common/User/User.class.php:1092:31
    
        public function setStatus($status)
    
    
      $status - src/common/User/User.class.php:1092:31
    
        public function setStatus($status)
    
    
      $this->status - src/common/User/User.class.php:1100:13
    
                $this->status = $status;
    
    
      PFUser::$status
    
        <no known location>
    
    
      $this->status - src/common/User/User.class.php:664:16
    
            return $this->status;
    
    
      PFUser::getStatus - src/common/User/User.class.php:662:21
    
        public function getStatus()
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      call to echo - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
    
    
    ERROR: TaintedHtml - plugins/ldap/bin/registerUser.php:80:22 - Detected tainted HTML (see https://psalm.dev/245)
    
      ParagonIE\EasyDB\EasyDB::run - tests/psalm/stubs/ParagonIE/EasyDB/EasyDB.phpstub:164:21
    
        public function run(string $statement, ...$params)
    
    
      Tuleap\Git\Notifications\UsersToNotifyDao::searchUsersByRepositoryId - plugins/git/include/Git/Notifications/UsersToNotifyDao.php:27:21
    
        public function searchUsersByRepositoryId($repository_id)
    
    
      arrayvalue-fetch - plugins/git/include/Git/Notifications/CollectionOfUserToBeNotifiedPresenterBuilder.php:41:18
    
            foreach ($this->dao->searchUsersByRepositoryId($repository->getId()) as $row) {
    
    
      $row - plugins/git/include/Git/Notifications/CollectionOfUserToBeNotifiedPresenterBuilder.php:41:81
    
            foreach ($this->dao->searchUsersByRepositoryId($repository->getId()) as $row) {
    
    
      call to PFUser::__construct - plugins/git/include/Git/Notifications/CollectionOfUserToBeNotifiedPresenterBuilder.php:42:41
    
                $user         = new \PFUser($row);
    
    
      PFUser::__construct#1 - src/common/User/User.class.php:213:33
    
        public function __construct($row = null)
    
    
      $row - src/common/User/User.class.php:213:33
    
        public function __construct($row = null)
    
    
      $row['status'] - src/common/User/User.class.php:226:72
    
            $this->status            = isset($row['status'])             ? $row['status']             : null;
    
    
      $this->status - src/common/User/User.class.php:226:9
    
            $this->status            = isset($row['status'])             ? $row['status']             : null;
    
    
      PFUser::$status
    
        <no known location>
    
    
      $this->status - src/common/User/User.class.php:664:16
    
            return $this->status;
    
    
      PFUser::getStatus - src/common/User/User.class.php:662:21
    
        public function getStatus()
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      concat - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
      call to echo - plugins/ldap/bin/registerUser.php:80:22
    
                    echo "ID=" . $user->getId() . ":STATUS=" . $user->getStatus() . "\n";
    
    
    
    
    ------------------------------
    
    3 errors found
    
    ------------------------------
    
    Authentication & LDAP
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Closed
    2022-06-17
    Attachments
    Empty
    References

    Follow-ups

    User avatar

    Integrated in Tuleap 13.9.99.145


    • Status changed from Under review to Closed
    • Connected artifacts
    • Close date set to 2022-06-17