4 개 항목 찾음
취약점
Abstract
모든 환경, GET, POST, 쿠키 및 서버 변수를 전역으로 등록하도록 PHP를 구성하면 예상치 못한 동작이 나타나거나 공격자에게 문을 열어주게 됩니다.
Explanation
register_globals 옵션을 활성화하면 PHP가 모든 EGPCS(환경, GET, POST, 쿠키 및 서버) 변수를 전역으로 등록할 수 있습니다. 이는 모든 PHP 프로그램의 모든 범위에 접근할 수 있습니다. 이 옵션을 사용하면 프로그래머가 주로 사용하는 최초 값을 조금은 알아보기 힘든 프로그램을 작성하도록 하여 시작 환경에서 예상치 못한 동작을 일으키거나 악의적인 환경에 있는 공격자에게 문을 열어주게 됩니다. register_globals가 위험한 보안 해석으로 인정되어 이 옵션은 PHP 4.2.0에서 기본적으로 비활성화되었으며 PHP 6에서는 더 이상 사용되지 않거나 제거되었습니다.

예제 1: 다음 코드는 cross-site scripting에 취약합니다. 프로그래머는 $username 값이 서버에서 제어하는 세션에서 오지만 공격자가 요청 매개 변수로 $username의 악의적인 값을 제공할 수 있다고 가정합니다. register_globals가 활성화되면 이 코드에 공격자가 전송한 악의적인 값이 생성된 동적 HTML 콘텐트로 포함됩니다.


<?php
if (isset($username)) {
echo "Hello <b>$username</b>";
} else {
echo "Hello <b>Guest</b><br />";
echo "Would you like to login?";

}
?>
References
[1] M. Achour et al. PHP Manual
[2] Artur Maj Securing PHP
[3] Standards Mapping - Common Weakness Enumeration CWE ID 473
[4] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[5] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[6] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[7] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[8] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[9] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[10] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.10
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.10
[13] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.10
[14] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.10
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.10
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[18] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[19] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection
[20] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection
[21] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.php.php_misconfiguration_register_globals
Abstract
프로그램은 변수를 덮어쓰고 공격자를 위한 문을 열 수도 있는 함수를 호출합니다.
Explanation
이미 초기화된 변수를 덮어쓸 수 있는 함수로 인해, 공격자는 덮어쓴 변수에 의존하는 코드의 실행에 영향을 미칠 수 있습니다.
변수를 덮어쓸 수 있습니다.

예제 1: 공격자가 ColdFusion 코드의 다음 세그먼트에서 varName에 대한 악성 값을 공급하면 SetVariable()에 대한 호출이 #first# 등 모든 임의 변수를 덮어쓸 수 있습니다. 이 경우, JavaScript를 포함하는 악성 값이 #first#를 덮어쓰면 프로그램이 Cross-Site Scripting에 취약해집니다.


<cfset first = "User">
<cfscript>
SetVariable(url.varName, url.varValue);
</cfscript>
<cfoutput>
#first#
</cfoutput>
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 473
[2] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310
[3] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[4] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[5] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[6] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-CODE-4
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.6
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.6
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.6
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.6
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[12] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[13] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[14] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation
[15] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation, Control Objective C.3.2 - Web Software Attack Mitigation
[16] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II
[17] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II
[18] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II
desc.dataflow.cfml.possible_variable_overwrite
Abstract
프로그램은 현재 범위에서 변수를 덮어쓰고 공격자를 위한 문을 열 수도 있는 함수를 호출합니다.
Explanation
현재 범위에서 이미 초기화된 변수를 덮어쓸 수 있는 함수로 인해, 공격자는 덮어쓴 변수에 의존하는 코드의 실행에 영향을 미칠 수 있습니다.
예제 1: 공격자가 PHP 코드의 다음 세그먼트에서 str에 대한 악성 값을 공급하면 parse_str()에 대한 호출이 first를 포함하여 현재 범위의 모든 임의 변수를 덮어쓸 수 있습니다. 이 경우, JavaScript를 포함하는 악성 값이 first를 덮어쓰면 프로그램이 Cross-Site Scripting에 취약해집니다.


<?php
$first="User";
...
$str = $_SERVER['QUERY_STRING'];
parse_str($str);
echo $first;
?>
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 473
[2] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310
[3] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[4] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[5] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.6
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.6
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.6
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.6
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[12] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[13] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation
[14] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation, Control Objective C.3.2 - Web Software Attack Mitigation
[15] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II
[16] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II
[17] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II
desc.dataflow.php.possible_variable_overwrite_current_scope
Abstract
프로그램은 전역 변수를 덮어쓰고 공격자를 위한 문을 열 수도 있는 함수를 호출합니다.
Explanation
이미 초기화된 전역 변수를 덮어쓸 수 있는 함수로 인해, 공격자는 덮어쓴 변수에 의존하는 코드의 실행에 영향을 미칠 수 있습니다.
예제 1:공격자가 PHP 코드의 다음 세그먼트에서 str에 대한 악성 값을 공급하면 mb_parse_str()에 대한 호출이 first를 포함하여 모든 임의 변수를 덮어쓸 수 있습니다. 이 경우, JavaScript를 포함하는 악성 값이 first를 덮어쓰면 프로그램이 Cross-Site Scripting에 취약해집니다.


<?php
$first="User";
...
$str = $_SERVER['QUERY_STRING'];
mb_parse_str($str);
echo $first;
?>
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 473
[2] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310
[3] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[4] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[5] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[6] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.6
[7] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.6
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.6
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.6
[10] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[11] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[12] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[13] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation
[14] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation, Control Objective C.3.2 - Web Software Attack Mitigation
[15] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II
[16] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II
[17] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II
desc.dataflow.php.possible_variable_overwrite_global