From f9fa6d04154ad03eb3480648127cef32c53ca0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 12 Apr 2022 14:28:38 +0200 Subject: [PATCH] Mark parameter in ext/ftp as sensitive --- ext/ftp/ftp.stub.php | 1 + ext/ftp/ftp_arginfo.h | 4 +++- ext/ftp/php_ftp.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/ftp/ftp.stub.php b/ext/ftp/ftp.stub.php index 70fdd2511909c..eed2e6a2ce073 100644 --- a/ext/ftp/ftp.stub.php +++ b/ext/ftp/ftp.stub.php @@ -75,6 +75,7 @@ function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\C function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {} #endif + /** @sensitive-param $password */ function ftp_login(FTP\Connection $ftp, string $username, string $password): bool {} function ftp_pwd(FTP\Connection $ftp): string|false {} function ftp_cdup(FTP\Connection $ftp): bool {} diff --git a/ext/ftp/ftp_arginfo.h b/ext/ftp/ftp_arginfo.h index 42ebb40475a9d..01c6c94781406 100644 --- a/ext/ftp/ftp_arginfo.h +++ b/ext/ftp/ftp_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: bd80737c67a0c10119f97988e41a08870b1f1af9 */ + * Stub hash: f3728c451a9cd130e9ffdf48389e2f68b4f82423 */ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_connect, 0, 1, FTP\\Connection, MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) @@ -293,6 +293,8 @@ static void register_ftp_symbols(int module_number) REGISTER_LONG_CONSTANT("FTP_FAILED", PHP_FTP_FAILED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FTP_FINISHED", PHP_FTP_FINISHED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("FTP_MOREDATA", PHP_FTP_MOREDATA, CONST_CS | CONST_PERSISTENT); + + zend_mark_function_parameter_as_sensitive(CG(function_table), "ftp_login", 2); } static zend_class_entry *register_class_FTP_Connection(void) diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index d8e29444249c1..75d106bc48a69 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -29,6 +29,7 @@ #include "ext/standard/info.h" #include "ext/standard/file.h" +#include "Zend/zend_attributes.h" #include "Zend/zend_exceptions.h" #include "php_ftp.h"