PHP import_request_variables()函数任意变量覆盖漏洞

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

PHP是广泛使用的通用目的脚本语言,特别适合于Web开发,可嵌入到HTML中。 PHP的import_request_variables()函数实现上存在漏洞,远程攻击者可能利用此漏洞控制服务器。 远程攻击者可以利用PHP的import_request_variables()函数覆盖$_*和$*变量(任意php变量),导致执行任意代码。有漏洞代码位于以下文件中: ./ext/standard/basic_functions.c:PHP_FUNCTION(import_request_variables) ./Zend/zend_hash.c:ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int num_args, ...) 有漏洞的代码段如下: PHP_FUNCTION(import_request_variables) { [..] if (prefix_len == 0) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix specified - possible security hazard"); } [..] for (p = types; p && *p; p++) { switch (*p) { case 'g': case 'G': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len);break; case 'p': case 'P': zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]), (apply_func_args_t) copy_request_variable, 2, prefix, prefix_len);...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息