Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,10 @@ ZEND_FUNCTION(get_defined_constants)

static bool backtrace_is_arg_sensitive(const zend_execute_data *call, uint32_t offset)
{
if (call->sensitive_args & (1u << offset)) {
return true;
}

const zend_attribute *attribute = zend_get_parameter_attribute_str(
call->func->common.attributes,
"sensitiveparameter",
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ struct _zend_execute_data {
zend_array *symbol_table;
void **run_time_cache; /* cache op_array->run_time_cache */
zend_array *extra_named_params;
uint32_t sensitive_args; /* bitmask for args */
};

#define ZEND_CALL_HAS_THIS IS_OBJECT_EX
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -4453,6 +4453,7 @@ static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array,
#endif
EX(call) = NULL;
EX(return_value) = return_value;
EX(sensitive_args) = 0;

/* Handle arguments */
first_extra_arg = op_array->num_args;
Expand Down Expand Up @@ -4540,6 +4541,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
EX(opline) = op_array->opcodes;
EX(call) = NULL;
EX(return_value) = return_value;
EX(sensitive_args) = 0;

if (op_array->last_var) {
zend_attach_symbol_table(execute_data);
Expand Down
14 changes: 14 additions & 0 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,20 @@ static zend_result _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue
CURLcode error = CURLE_OK;
zend_long lval;

switch (option) {
case CURLOPT_KEYPASSWD:
case CURLOPT_PASSWORD:
case CURLOPT_PROXY_KEYPASSWD:
case CURLOPT_PROXY_TLSAUTH_PASSWORD:
case CURLOPT_PROXYPASSWORD:
case CURLOPT_PROXYUSERPWD:
case CURLOPT_SSLKEY_BLOB:
case CURLOPT_TLSAUTH_PASSWORD:
case CURLOPT_USERPWD:
case CURLOPT_XOAUTH2_BEARER:
EG(current_execute_data)->sensitive_args |= (1u << 2);
}

switch (option) {
/* Callable options */
HANDLE_CURL_OPTION_CALLABLE_PHP_CURL_USER(ch, CURLOPT_WRITE, write, PHP_CURL_STDOUT);
Expand Down
Loading