1464 개 항목 찾음
취약점
Abstract
μ‹ λ’°ν•  수 μ—†λŠ” μ†ŒμŠ€μ—μ„œ λ‚˜μ˜¨ μž…λ ₯을 λ°›μ•„ λ™μ μœΌλ‘œ SQL 문을 μƒμ„±ν•˜λ©΄ κ³΅κ²©μžκ°€ ν•΄λ‹Ή 문의 의미λ₯Ό μˆ˜μ •ν•˜κ±°λ‚˜ μž„μ˜μ˜ SQL λͺ…령을 μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
Explanation
SQL injection 였λ₯˜λŠ” λ‹€μŒ κ²½μš°μ— λ°œμƒν•©λ‹ˆλ‹€.

1. μ‹ λ’°ν•  수 μ—†λŠ” μ†ŒμŠ€μ—μ„œ 데이터가 ν”„λ‘œκ·Έλž¨μ— μž…λ ₯λ©λ‹ˆλ‹€.

이런 경우, Fortify Static Code AnalyzerλŠ” 데이터 μ†ŒμŠ€λ₯Ό μ‹ λ’°ν•  수 μžˆλŠ” κ²ƒμœΌλ‘œ νŒλ‹¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

2. 데이터λ₯Ό μ‚¬μš©ν•˜μ—¬ SQL 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•©λ‹ˆλ‹€.

예제 1: λ‹€μŒ μ½”λ“œλŠ” μ§€μ •λœ 이름과 μΌμΉ˜ν•˜λŠ” ν•­λͺ©μ„ κ²€μƒ‰ν•˜λŠ” SQL 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•˜κ³  μ‹€ν–‰ν•©λ‹ˆλ‹€. μΏΌλ¦¬λŠ” ν‘œμ‹œλ˜λŠ” ν•­λͺ©μ„ ν•­λͺ© μ†Œμœ μžκ°€ ν˜„μž¬ 인증된 μ‚¬μš©μžμ˜ 이름과 μΌμΉ˜ν•˜λŠ” ν•­λͺ©μœΌλ‘œ μ œν•œν•©λ‹ˆλ‹€.


...
String userName = ctx.getAuthenticatedUserName();
String itemName = request.getParameter("itemName");
String query = "SELECT * FROM items WHERE owner = '"
+ userName + "' AND itemname = '"
+ itemName + "'";
ResultSet rs = stmt.execute(query);
...


μΏΌλ¦¬λŠ” λ‹€μŒ μ½”λ“œλ₯Ό μ‹€ν–‰ν•˜λ €κ³  ν•©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = <userName>
AND itemname = <itemName>;


ν•˜μ§€λ§Œ μƒμˆ˜μΈ κΈ°λ³Έ 쿼리 λ¬Έμžμ—΄κ³Ό μ‚¬μš©μž μž…λ ₯ λ¬Έμžμ—΄μ„ μ—°κ²°ν•˜μ—¬ 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•˜κΈ° λ•Œλ¬Έμ—, μΏΌλ¦¬λŠ” itemName에 μž‘μ€λ”°μ˜΄ν‘œκ°€ λ“€μ–΄ μžˆμ§€ μ•Šμ€ κ²½μš°μ—λ§Œ μ •ν™•ν•˜κ²Œ λ™μž‘ν•©λ‹ˆλ‹€. μ‚¬μš©μž 이름이 wiley인 κ³΅κ²©μžκ°€ itemName에 λ¬Έμžμ—΄ "name' OR 'a'='a"λ₯Ό μž…λ ₯ν•˜λ©΄ μΏΌλ¦¬λŠ” λ‹€μŒκ³Ό 같이 μƒμ„±λ©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name' OR 'a'='a';
OR 'a'='a' 쑰건을 μΆ”κ°€ν•˜λ©΄ where 절이 항상 true둜 ν‰κ°€ν•˜κΈ° λ•Œλ¬Έμ— μΏΌλ¦¬λŠ” 훨씬 κ°„λ‹¨ν•œ λ‹€μŒ 쿼리와 λ…Όλ¦¬μ μœΌλ‘œ λ™μΌν•˜κ²Œ λ©λ‹ˆλ‹€.


SELECT * FROM items;


κ³΅κ²©μžλŠ” μ΄λ ‡κ²Œ 쿼리λ₯Ό λ‹¨μˆœν™”ν•˜μ—¬ 쿼리가 인증된 μ‚¬μš©μžκ°€ μ†Œμœ ν•œ ν•­λͺ©λ§Œ λ°˜ν™˜ν•΄μ•Ό ν•œλ‹€λŠ” μš”κ΅¬ 사항을 λ¬΄μ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이제 μΏΌλ¦¬λŠ” μ§€μ •λœ μ†Œμœ μžμ™€ 관계없이 items ν…Œμ΄λΈ”μ— μ €μž₯된 λͺ¨λ“  ν•­λͺ©μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€.

예제 2: 이 μ˜ˆμ œλŠ” Example 1μ—μ„œ μƒμ„±ν•˜μ—¬ μˆ˜ν–‰ν•œ 쿼리에 또 λ‹€λ₯Έ μ•…μ„± 값이 전달될 λ•Œμ˜ κ²°κ³Όλ₯Ό κ²€ν† ν•©λ‹ˆλ‹€. μ‚¬μš©μž 이름이 wiley인 κ³΅κ²©μžκ°€ itemName에 λ¬Έμžμ—΄ "name'; DELETE FROM items; --"λ₯Ό μž…λ ₯ν•˜λ©΄ μΏΌλ¦¬λŠ” λ‹€μŒκ³Ό 같은 두 개의 쿼리가 λ©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name';

DELETE FROM items;

--'


Microsoft(R) SQL Server 2000을 ν¬ν•¨ν•œ λ§Žμ€ λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œ μ—¬λŸ¬ SQL 문을 μ„Έλ―Έμ½œλ‘ μœΌλ‘œ κ΅¬λΆ„ν•˜μ—¬ ν•œκΊΌλ²ˆμ— μ‹€ν–‰ν•˜λŠ” 것을 ν—ˆμš©ν•©λ‹ˆλ‹€. 이 곡격 λ¬Έμžμ—΄μ€ μ„Έλ―Έμ½œλ‘ μœΌλ‘œ κ΅¬λΆ„ν•œ 문에 λŒ€ν•œ 일괄 싀행을 ν—ˆμš©ν•˜μ§€ μ•ŠλŠ” Oracle 및 기타 λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œλŠ” 였λ₯˜λ₯Ό μΌμœΌν‚€μ§€λ§Œ 일괄 싀행을 ν—ˆμš©ν•˜λŠ” λ°μ΄ν„°λ² μ΄μŠ€μ—μ„œλŠ” κ³΅κ²©μžκ°€ 이런 μ’…λ₯˜μ˜ 곡격으둜 λ°μ΄ν„°λ² μ΄μŠ€μ— λŒ€ν•΄ μž„μ˜μ˜ λͺ…령을 μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ§ˆμ§€λ§‰μ˜ ν•˜μ΄ν”ˆ 쌍(--)을 λ³΄κ² μŠ΅λ‹ˆλ‹€. μ΄λŠ” λŒ€λΆ€λΆ„μ˜ λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œ ν•΄λ‹Ή 문에 λŒ€ν•œ λ‚˜λ¨Έμ§€ 뢀뢄을 μ£Όμ„μœΌλ‘œ μ²˜λ¦¬ν•˜μ—¬ μ‹€ν–‰ν•˜μ§€ λ§λΌλŠ” 의미둜 ν•΄μ„λ©λ‹ˆλ‹€[4]. 이 경우, 이 주석 λ¬ΈμžλŠ” μˆ˜μ •λœ μΏΌλ¦¬μ—μ„œ λ§ˆμ§€λ§‰μ˜ μž‘μ€λ”°μ˜΄ν‘œ ν•œμͺ½μ„ μ œκ±°ν•˜λŠ” 역할을 ν•©λ‹ˆλ‹€. 주석을 이런 μ‹μœΌλ‘œ μ‚¬μš©ν•  수 μ—†λŠ” λ°μ΄ν„°λ² μ΄μŠ€μ—μ„œλ„ Example 1μ—μ„œ μ‚¬μš©λœ 것과 μœ μ‚¬ν•œ μ†μž„μˆ˜λ₯Ό μ‚¬μš©ν•˜λ©΄ λŒ€λΆ€λΆ„μ˜ 곡격이 효과λ₯Ό κ±°λ‘˜ 수 μžˆμŠ΅λ‹ˆλ‹€. κ³΅κ²©μžκ°€ λ¬Έμžμ—΄ "name'); DELETE FROM items; SELECT * FROM items WHERE 'a'='a"λ₯Ό μž…λ ₯ν•˜μ—¬ λ‹€μŒ μ„Έ 가지 μœ νš¨ν•œ 문을 λ§Œλ“œλŠ” κ²½μš°μž…λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name';

DELETE FROM items;

SELECT * FROM items WHERE 'a'='a';


λͺ¨λ°”일 ν™˜κ²½μ—μ„œλŠ” SQL Injectionκ³Ό 같은 μ „ν˜•μ μΈ μ›Ή μ‘μš© ν”„λ‘œκ·Έλž¨ 취약성이 λ°œμƒν•˜μ§€ μ•ŠλŠ”λ‹€κ³  μƒκ°ν•˜λŠ” μ‚¬μš©μžλ„ μžˆμŠ΅λ‹ˆλ‹€. 자기 μžμ‹ μ„ κ³΅κ²©ν•˜λŠ” μ‚¬μš©μžλŠ” 없을 것이라 μ—¬κΈ°κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ λͺ¨λ°”일 ν”Œλž«νΌμ˜ 핡심 μš”μ†ŒλŠ” λ‹€μ–‘ν•œ μ†ŒμŠ€μ—μ„œ λ‹€μš΄λ‘œλ“œλ˜μ–΄ 같은 μž₯μΉ˜μ—μ„œ ν•¨κ»˜ μ‹€ν–‰λ˜λŠ” μ‘μš© ν”„λ‘œκ·Έλž¨μ΄λΌλŠ” 점을 μœ λ…ν•΄μ•Ό ν•©λ‹ˆλ‹€. 즉 금육 μ‘μš© ν”„λ‘œκ·Έλž¨κ³Ό 맬웨어λ₯Ό ν•¨κ»˜ μ‹€ν–‰ν•  κ°€λŠ₯성이 λ†’μœΌλ―€λ‘œ ν”„λ‘œμ„ΈμŠ€ κ°„ 톡신을 ν¬ν•¨ν•˜λ„λ‘ λͺ¨λ°”일 μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ 곡격 ν‘œλ©΄μ„ ν™•μž₯ν•΄μ•Ό ν•©λ‹ˆλ‹€.

예제 3: λ‹€μŒ μ½”λ“œλŠ” Example 1을 Android ν”Œλž«νΌμ— 맞게 μ‘°μ •ν•©λ‹ˆλ‹€.


...
PasswordAuthentication pa = authenticator.getPasswordAuthentication();
String userName = pa.getUserName();
String itemName = this.getIntent().getExtras().getString("itemName");
String query = "SELECT * FROM items WHERE owner = '"
+ userName + "' AND itemname = '"
+ itemName + "'";
SQLiteDatabase db = this.openOrCreateDatabase("DB", MODE_PRIVATE, null);
Cursor c = db.rawQuery(query, null);
...


SQL Injection 곡격을 λ°©μ§€ν•˜λŠ” ν•œ 가지 기쑴의 μ ‘κ·Ό 방식은 곡격을 μž…λ ₯κ°’ 검증 문제둜 μ²˜λ¦¬ν•˜κ³  μ•ˆμ „ν•œ κ°’ λͺ©λ‘(ν—ˆμš© λͺ©λ‘)의 문자만 λ°›κ±°λ‚˜ μ•…μ˜μ μΌ κ°€λŠ₯성이 μžˆλŠ” κ°’ λͺ©λ‘(κ±°λΆ€ λͺ©λ‘)을 μ‹λ³„ν•˜μ—¬ μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. ν—ˆμš© λͺ©λ‘ κ²€μ‚¬λŠ” μ—„κ²©ν•œ μž…λ ₯κ°’ 검증 κ·œμΉ™μ„ μ΄ν–‰ν•˜λŠ” 맀우 효율적인 μˆ˜λ‹¨μ΄ λ˜κΈ°λ„ ν•˜μ§€λ§Œ, 맀개 λ³€μˆ˜κ°€ μžˆλŠ” SQL 문은 μœ μ§€ 관리가 쉽고 보닀 κ°•λ ₯ν•œ λ³΄μ•ˆμ„ μ œκ³΅ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λŒ€λΆ€λΆ„μ˜ 경우 κ±°λΆ€ λͺ©λ‘ κ΅¬ν˜„μ€ SQL Injection 곡격 λ°©μ§€μ˜ 효과λ₯Ό λ–¨μ–΄λœ¨λ¦¬λŠ” ν—ˆμ μ΄ μ•„μ£Ό λ§ŽμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, κ³΅κ²©μžλŠ” λ‹€μŒκ³Ό 같이 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

- λ”°μ˜΄ν‘œλ‘œ 묢지 μ•Šμ€ ν•„λ“œλ₯Ό λ…Έλ¦½λ‹ˆλ‹€.
- μ΄μŠ€μΌ€μ΄ν”„ 처리된 메타 문자λ₯Ό μ‚¬μš©ν•  ν•„μš”κ°€ μ—†λŠ” 방법을 μ°ΎμŠ΅λ‹ˆλ‹€.
- μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λ₯Ό μ‚¬μš©ν•˜μ—¬ μ‚½μž…λœ 메타 문자λ₯Ό μˆ¨κΉλ‹ˆλ‹€.

SQL 쿼리에 μž…λ ₯ν•  λ•Œ μˆ˜λ™μœΌλ‘œ 문자λ₯Ό μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” 방법도 μžˆμ§€λ§Œ μ΄κ²ƒμœΌλ‘œ SQL injection κ³΅κ²©μœΌλ‘œλΆ€ν„° μ‘μš© ν”„λ‘œκ·Έλž¨μ„ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.

SQL injection 곡격을 λ‹€λ£¨λŠ” 데 주둜 μ œμ‹œλ˜λŠ” λ‹€λ₯Έ μ†”λ£¨μ…˜μ€ μ €μž₯ ν”„λ‘œμ‹œμ €(stored procedure)λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μœ ν˜•μ˜ SQL injection 곡격은 막을 수 μžˆμ§€λ§Œ λ‹€λ₯Έ λ§Žμ€ μœ ν˜•μ€ 막지 λͺ»ν•©λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일반적으둜 맀개 λ³€μˆ˜μ— μ „λ‹¬λ˜λŠ” SQL 문의 μœ ν˜•μ„ μ œν•œν•˜μ—¬ SQL injection 곡격을 λ§‰μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 μ œμ•½μ„ ν”Όν•  수 μžˆλŠ” λ§Žμ€ 방법이 μžˆμ–΄ μˆ˜λ§Žμ€ 비정상적인 문을 μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)에 전달할 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν’€μ΄ν•˜μ§€λ§Œ, μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μ΅μŠ€ν”Œλ‘œμ΄νŠΈλŠ” 막을 수 μžˆμ§€λ§Œ μ‘μš© ν”„λ‘œκ·Έλž¨μ„ SQL injection 곡격에 λŒ€ν•΄ μ•ˆμ „ν•˜κ²Œ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.
References
[1] S. J. Friedl SQL Injection Attacks by Example
[2] P. Litwin Stop SQL Injection Attacks Before They Stop You MSDN Magazine
[3] P. Finnigan SQL Injection and Oracle, Part One Security Focus
[4] M. Howard, D. LeBlanc Writing Secure Code, Second Edition Microsoft Press
[5] IDS00-J. Prevent SQL Injection CERT
[6] INJECT-2: Avoid dynamic SQL Oracle
[7] Standards Mapping - Common Weakness Enumeration CWE ID 89
[8] Standards Mapping - Common Weakness Enumeration Top 25 2019 [6] CWE ID 089
[9] Standards Mapping - Common Weakness Enumeration Top 25 2020 [6] CWE ID 089
[10] Standards Mapping - Common Weakness Enumeration Top 25 2021 [6] CWE ID 089
[11] Standards Mapping - Common Weakness Enumeration Top 25 2022 [3] CWE ID 089
[12] Standards Mapping - Common Weakness Enumeration Top 25 2023 [3] CWE ID 089
[13] Standards Mapping - Common Weakness Enumeration Top 25 2024 [3] CWE ID 089
[14] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310, CCI-002754
[15] Standards Mapping - FIPS200 SI
[16] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[17] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[18] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[19] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.3.4 Output Encoding and Injection Prevention Requirements (L1 L2 L3), 5.3.5 Output Encoding and Injection Prevention Requirements (L1 L2 L3)
[20] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[21] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-CODE-4, MASVS-PLATFORM-1
[22] Standards Mapping - OWASP Top 10 2004 A6 Injection Flaws
[23] Standards Mapping - OWASP Top 10 2007 A2 Injection Flaws
[24] Standards Mapping - OWASP Top 10 2010 A1 Injection
[25] Standards Mapping - OWASP Top 10 2013 A1 Injection
[26] Standards Mapping - OWASP Top 10 2017 A1 Injection
[27] Standards Mapping - OWASP Top 10 2021 A03 Injection
[28] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[29] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1, Requirement 6.5.2
[30] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[31] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[32] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[33] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[34] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[35] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[36] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[37] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[38] 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
[39] 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
[40] Standards Mapping - SANS Top 25 2009 Insecure Interaction - CWE ID 089
[41] Standards Mapping - SANS Top 25 2010 Insecure Interaction - CWE ID 089
[42] Standards Mapping - SANS Top 25 2011 Insecure Interaction - CWE ID 089
[43] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[44] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[48] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[49] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[50] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[51] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[52] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[53] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[54] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[55] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[56] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[57] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[58] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[59] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[60] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[61] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[62] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[63] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[64] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[65] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[66] Standards Mapping - Web Application Security Consortium Version 2.00 SQL Injection (WASC-19)
[67] Standards Mapping - Web Application Security Consortium 24 + 2 SQL Injection
desc.semantic.java.sql_injection_persistence
Abstract
HTML, XML 및 λ‹€λ₯Έ ν˜•μ‹μ˜ 인코딩을 μ‚¬μš©ν•˜μ—¬ μ‹ λ’°ν•  수 μ—†λŠ” μž…λ ₯을 κ²€μ¦ν•˜λ©΄ κ³΅κ²©μžκ°€ 문의 의미λ₯Ό λ³€κ²½ν•˜κ±°λ‚˜ μž„μ˜μ˜ SQL λͺ…령을 μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
Explanation
mysql_real_escape_string() 같은 인코딩 ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜λ©΄ 일뢀 SQL Injection 취약점이 λ°©μ§€λ˜μ§€λ§Œ μ „λΆ€ λ°©μ§€λ˜μ§€λŠ” μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 인코딩 ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•˜λŠ” 것은 μ•½ν•œ κ±°λΆ€ λͺ©λ‘μ„ μ‚¬μš©ν•˜μ—¬ SQL Injection을 μ°¨λ‹¨ν•˜λŠ” 것과 λ™μΌν•˜λ©° κ³΅κ²©μžκ°€ 문의 의미λ₯Ό μˆ˜μ •ν•˜κ±°λ‚˜ μž„μ˜μ˜ SQL λͺ…령을 μ‹€ν–‰ν•˜λŠ” 것이 κ°€λŠ₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λ™μ μœΌλ‘œ ν•΄μ„λ˜λŠ” μ½”λ“œμ˜ μ§€μ •λœ μ„Ήμ…˜ λ‚΄μ—μ„œ μž…λ ₯이 ν‘œμ‹œλ˜λŠ” μœ„μΉ˜λ₯Ό μ •μ μœΌλ‘œ ν™•μΈν•˜λŠ” 것이 항상 κ°€λŠ₯ν•˜μ§€λŠ” μ•ŠμœΌλ―€λ‘œ Fortify Secure Coding RulepacksλŠ” ν•΄λ‹Ή μ»¨ν…μŠ€νŠΈ λ‚΄μ—μ„œ 검증을 톡해 μΆ©λΆ„νžˆ SQL Injection을 차단할 수 μžˆλŠ” κ²½μš°μ—λ„ κ²€μ¦λœ 동적 SQL 데이터λ₯Ό "SQL Injection: Poor Validation" 이슈둜 ν‘œμ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€.

SQL Injection 였λ₯˜λŠ” λ‹€μŒ κ²½μš°μ— λ°œμƒν•©λ‹ˆλ‹€.

1. μ‹ λ’°ν•  수 μ—†λŠ” μ†ŒμŠ€μ—μ„œ 데이터가 ν”„λ‘œκ·Έλž¨μ— μž…λ ₯λ©λ‹ˆλ‹€.



2. 데이터λ₯Ό μ‚¬μš©ν•˜μ—¬ SQL 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•©λ‹ˆλ‹€.

예제 1: λ‹€μŒ μ˜ˆμ œλŠ” λ°μ΄ν„°λ² μ΄μŠ€μ˜ κ΅¬μ„±μœΌλ‘œ 인해 변경될 수 μžˆλŠ” mysqli_real_escape_string()의 λ™μž‘μ„ λ³΄μ—¬μ€λ‹ˆλ‹€. SQL λͺ¨λ“œκ°€ "NO_BACKSLASH_ESCAPES"둜 μ„€μ •λœ 경우 λ°±μŠ¬λž˜μ‹œ λ¬Έμžκ°€ μ΄μŠ€μΌ€μ΄ν”„ 문자[5]κ°€ μ•„λ‹Œ 일반 문자둜 μ²˜λ¦¬λ©λ‹ˆλ‹€. mysqli_real_escape_string()은 이λ₯Ό κ³ λ €ν•˜λ―€λ‘œ λ‹€μŒ μΏΌλ¦¬λŠ” SQL Injection에 μ·¨μ•½ν•΄μ§‘λ‹ˆλ‹€. λ°μ΄ν„°λ² μ΄μŠ€ κ΅¬μ„±μœΌλ‘œ 인해 "κ°€ 더 이상 \"둜 μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬λ˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€.


mysqli_query($mysqli, 'SET SQL_MODE="NO_BACKSLASH_ESCAPES"');
...
$userName = mysqli_real_escape_string($mysqli, $_POST['userName']);
$pass = mysqli_real_escape_string($mysqli, $_POST['pass']);
$query = 'SELECT * FROM users WHERE userName="' . $userName . '"AND pass="' . $pass. '";';
$result = mysqli_query($mysqli, $query);
...


κ³΅κ²©μžκ°€ password ν•„λ“œλ₯Ό λΉ„μ›Œ 두고 " OR 1=1;-- 을 userName으둜 μž…λ ₯ν•˜λ©΄ λ”°μ˜΄ν‘œκ°€ μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬λ˜μ§€ μ•Šκ³  λ‹€μŒκ³Ό 같은 쿼리가 μƒμ„±λ©λ‹ˆλ‹€.


SELECT * FROM users
WHERE userName = ""
OR 1=1;
-- "AND pass="";
OR 1=1둜 인해 where 절이 항상 true둜 ν‰κ°€λ˜κ³  ν•˜μ΄ν”ˆ 두 개둜 인해 λ‚˜λ¨Έμ§€ 문이 μ£Όμ„μœΌλ‘œ μ²˜λ¦¬λ˜λ―€λ‘œ 이 μΏΌλ¦¬λŠ” 훨씬 더 λ‹¨μˆœν•œ 쿼리와 λ…Όλ¦¬μ μœΌλ‘œ λ™μΌν•΄μ§‘λ‹ˆλ‹€.


SELECT * FROM users;



SQL Injection 곡격을 λ°©μ§€ν•˜λŠ” ν•œ 가지 기쑴의 μ ‘κ·Ό 방식은 곡격을 μž…λ ₯κ°’ 검증 문제둜 μ²˜λ¦¬ν•˜κ³  μ•ˆμ „ν•œ κ°’ λͺ©λ‘(ν—ˆμš© λͺ©λ‘)의 문자만 λ°›κ±°λ‚˜ μ•…μ˜μ μΌ κ°€λŠ₯성이 μžˆλŠ” κ°’ λͺ©λ‘(κ±°λΆ€ λͺ©λ‘)을 μ‹λ³„ν•˜μ—¬ μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. ν—ˆμš© λͺ©λ‘ κ²€μ‚¬λŠ” μ—„κ²©ν•œ μž…λ ₯κ°’ 검증 κ·œμΉ™μ„ μ΄ν–‰ν•˜λŠ” 맀우 효율적인 μˆ˜λ‹¨μ΄ λ˜κΈ°λ„ ν•˜μ§€λ§Œ, 맀개 λ³€μˆ˜κ°€ μžˆλŠ” SQL 문은 μœ μ§€ 관리가 쉽고 보닀 κ°•λ ₯ν•œ λ³΄μ•ˆμ„ μ œκ³΅ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λŒ€λΆ€λΆ„μ˜ 경우 κ±°λΆ€ λͺ©λ‘ κ΅¬ν˜„μ€ SQL Injection 곡격 λ°©μ§€μ˜ 효과λ₯Ό λ–¨μ–΄λœ¨λ¦¬λŠ” ν—ˆμ μ΄ μ•„μ£Ό λ§ŽμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, κ³΅κ²©μžλŠ” λ‹€μŒκ³Ό 같이 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

- λ”°μ˜΄ν‘œλ‘œ 묢지 μ•Šμ€ ν•„λ“œλ₯Ό λ…Έλ¦½λ‹ˆλ‹€.
- μ΄μŠ€μΌ€μ΄ν”„ 처리된 메타 문자λ₯Ό μ‚¬μš©ν•  ν•„μš”κ°€ μ—†λŠ” 방법을 μ°ΎμŠ΅λ‹ˆλ‹€.
- μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λ₯Ό μ‚¬μš©ν•˜μ—¬ μ‚½μž…λœ 메타 문자λ₯Ό μˆ¨κΉλ‹ˆλ‹€.

SQL 쿼리에 μž…λ ₯ν•  λ•Œ μˆ˜λ™μœΌλ‘œ 문자λ₯Ό μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” 방법도 μžˆμ§€λ§Œ μ΄κ²ƒμœΌλ‘œ SQL Injection κ³΅κ²©μœΌλ‘œλΆ€ν„° μ‘μš© ν”„λ‘œκ·Έλž¨μ„ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.

SQL Injection 곡격을 λ‹€λ£¨λŠ” 데 주둜 μ œμ‹œλ˜λŠ” λ‹€λ₯Έ μ†”λ£¨μ…˜μ€ μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μœ ν˜•μ˜ SQL Injection 곡격은 막을 수 μžˆμ§€λ§Œ λ‹€λ₯Έ λ§Žμ€ μœ ν˜•μ€ 막지 λͺ»ν•©λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일반적으둜 맀개 λ³€μˆ˜μ— μ „λ‹¬λ˜λŠ” SQL 문의 μœ ν˜•μ„ μ œν•œν•˜μ—¬ SQL Injection 곡격을 λ§‰μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 μ œμ•½μ„ ν”Όν•  수 μžˆλŠ” λ§Žμ€ 방법이 μžˆμ–΄ μˆ˜λ§Žμ€ 비정상적인 문을 μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)에 전달할 수 μžˆμŠ΅λ‹ˆλ‹€. λ‹€μ‹œ 말해, μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μ΅μŠ€ν”Œλ‘œμ΄νŠΈλŠ” 막을 수 μžˆμ§€λ§Œ μ‘μš© ν”„λ‘œκ·Έλž¨μ„ SQL Injection 곡격에 λŒ€ν•΄ μ•ˆμ „ν•˜κ²Œ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.
References
[1] S. J. Friedl SQL Injection Attacks by Example
[2] P. Litwin Stop SQL Injection Attacks Before They Stop You MSDN Magazine
[3] P. Finnigan SQL Injection and Oracle, Part One Security Focus
[4] M. Howard, D. LeBlanc Writing Secure Code, Second Edition Microsoft Press
[5] 5.1.8 Server SQL Modes MySQL
[6] Standards Mapping - Common Weakness Enumeration CWE ID 89
[7] Standards Mapping - Common Weakness Enumeration Top 25 2019 [6] CWE ID 089
[8] Standards Mapping - Common Weakness Enumeration Top 25 2020 [6] CWE ID 089
[9] Standards Mapping - Common Weakness Enumeration Top 25 2021 [6] CWE ID 089
[10] Standards Mapping - Common Weakness Enumeration Top 25 2022 [3] CWE ID 089
[11] Standards Mapping - Common Weakness Enumeration Top 25 2023 [3] CWE ID 089
[12] Standards Mapping - Common Weakness Enumeration Top 25 2024 [3] CWE ID 089
[13] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310, CCI-002754
[14] Standards Mapping - FIPS200 SI
[15] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[16] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[17] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[18] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.3.4 Output Encoding and Injection Prevention Requirements (L1 L2 L3), 5.3.5 Output Encoding and Injection Prevention Requirements (L1 L2 L3)
[19] Standards Mapping - OWASP Mobile 2014 M7 Client Side Injection
[20] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-CODE-4
[21] Standards Mapping - OWASP Top 10 2004 A6 Injection Flaws
[22] Standards Mapping - OWASP Top 10 2007 A2 Injection Flaws
[23] Standards Mapping - OWASP Top 10 2010 A1 Injection
[24] Standards Mapping - OWASP Top 10 2013 A1 Injection
[25] Standards Mapping - OWASP Top 10 2017 A1 Injection
[26] Standards Mapping - OWASP Top 10 2021 A03 Injection
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[28] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1, Requirement 6.5.2
[29] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[30] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[31] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[32] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[33] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[34] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[35] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[36] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[37] 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
[38] 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
[39] Standards Mapping - SANS Top 25 2009 Insecure Interaction - CWE ID 089
[40] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[41] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[42] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[43] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[44] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[48] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[50] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[51] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[52] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[53] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[54] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[55] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[56] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[57] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[58] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[59] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[60] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[61] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[62] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[63] Standards Mapping - Web Application Security Consortium Version 2.00 SQL Injection (WASC-19)
[64] Standards Mapping - Web Application Security Consortium 24 + 2 SQL Injection
desc.dataflow.php.sql_injection_poor_validation
Abstract
μ‹ λ’°ν•  수 μ—†λŠ” μ†ŒμŠ€μ—μ„œ λ‚˜μ˜¨ μž…λ ₯을 λ°›μ•„ λ™μ μœΌλ‘œ SubSonic 문을 μƒμ„±ν•˜λ©΄ κ³΅κ²©μžκ°€ ν•΄λ‹Ή 문의 의미λ₯Ό μˆ˜μ •ν•˜κ±°λ‚˜ μž„μ˜μ˜ SQL λͺ…령을 μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
Explanation
SubSonicκ³Ό κ΄€λ ¨λœ SQL injection 였λ₯˜λŠ” λ‹€μŒ κ²½μš°μ— λ°œμƒν•©λ‹ˆλ‹€.

1. μ‹ λ’°ν•  수 μ—†λŠ” μ†ŒμŠ€μ—μ„œ 데이터가 ν”„λ‘œκ·Έλž¨μ— μž…λ ₯λ©λ‹ˆλ‹€.

2. 데이터λ₯Ό μ‚¬μš©ν•˜μ—¬ 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•©λ‹ˆλ‹€.
예제 1: λ‹€μŒ μ½”λ“œλŠ” μ§€μ •λœ 이름과 μΌμΉ˜ν•˜λŠ” ν•­λͺ©μ„ κ²€μƒ‰ν•˜λŠ” SubSonic 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•˜κ³  μ‹€ν–‰ν•©λ‹ˆλ‹€. μΏΌλ¦¬λŠ” ν˜„μž¬ 인증된 μ‚¬μš©μžμ˜ 이름과 ownerκ°€ μΌμΉ˜ν•˜λŠ” ν•­λͺ©λ§Œ ν‘œμ‹œν•˜λ„λ‘ μ œν•œν•©λ‹ˆλ‹€.


...
string userName = ctx.getAuthenticatedUserName();
string query = "SELECT * FROM items WHERE owner = '"
+ userName + "' AND itemname = '"
+ ItemName.Text + "'";

IDataReader responseReader = new InlineQuery().ExecuteReader(query);
...


μΏΌλ¦¬λŠ” λ‹€μŒ μ½”λ“œλ₯Ό μ‹€ν–‰ν•˜λ €κ³  ν•©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = <userName>
AND itemname = <itemName>;


ν•˜μ§€λ§Œ μƒμˆ˜μΈ κΈ°λ³Έ 쿼리 λ¬Έμžμ—΄κ³Ό μ‚¬μš©μž μž…λ ₯ λ¬Έμžμ—΄μ„ μ—°κ²°ν•˜μ—¬ 쿼리λ₯Ό λ™μ μœΌλ‘œ μƒμ„±ν•˜κΈ° λ•Œλ¬Έμ—, μΏΌλ¦¬λŠ” itemName에 μž‘μ€λ”°μ˜΄ν‘œκ°€ λ“€μ–΄ μžˆμ§€ μ•Šμ€ κ²½μš°μ—λ§Œ μ •ν™•ν•˜κ²Œ λ™μž‘ν•©λ‹ˆλ‹€. μ‚¬μš©μž 이름이 wiley인 κ³΅κ²©μžκ°€ itemName에 λ¬Έμžμ—΄ "name' OR 'a'='a"λ₯Ό μž…λ ₯ν•˜λ©΄ μΏΌλ¦¬λŠ” λ‹€μŒκ³Ό 같이 μƒμ„±λ©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name' OR 'a'='a';
OR 'a'='a' 쑰건을 μΆ”κ°€ν•˜λ©΄ where 절이 항상 true둜 ν‰κ°€ν•˜κΈ° λ•Œλ¬Έμ— μΏΌλ¦¬λŠ” 훨씬 κ°„λ‹¨ν•œ λ‹€μŒ 쿼리와 λ…Όλ¦¬μ μœΌλ‘œ λ™μΌν•˜κ²Œ λ©λ‹ˆλ‹€.


SELECT * FROM items;


κ³΅κ²©μžλŠ” μ΄λ ‡κ²Œ 쿼리λ₯Ό λ‹¨μˆœν™”ν•˜μ—¬ 쿼리가 인증된 μ‚¬μš©μžκ°€ μ†Œμœ ν•œ ν•­λͺ©λ§Œ λ°˜ν™˜ν•΄μ•Ό ν•œλ‹€λŠ” μš”κ΅¬ 사항을 λ¬΄μ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이제 μΏΌλ¦¬λŠ” μ§€μ •λœ μ†Œμœ μžμ™€ 관계없이 items ν…Œμ΄λΈ”μ— μ €μž₯된 λͺ¨λ“  ν•­λͺ©μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€.

예제 2: 이 μ˜ˆμ œλŠ” Example 1μ—μ„œ μƒμ„±ν•˜μ—¬ μˆ˜ν–‰ν•œ 쿼리에 또 λ‹€λ₯Έ μ•…μ„± 값이 전달될 λ•Œμ˜ κ²°κ³Όλ₯Ό κ²€ν† ν•©λ‹ˆλ‹€. μ‚¬μš©μž 이름이 wiley인 κ³΅κ²©μžκ°€ itemName에 λ¬Έμžμ—΄ "name'); DELETE FROM items; --"λ₯Ό μž…λ ₯ν•˜λ©΄ μΏΌλ¦¬λŠ” λ‹€μŒκ³Ό 같은 두 개의 쿼리가 λ©λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name';

DELETE FROM items;

--'


Microsoft(R) SQL Server 2000을 ν¬ν•¨ν•œ λ§Žμ€ λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œ μ—¬λŸ¬ SQL 문을 μ„Έλ―Έμ½œλ‘ μœΌλ‘œ κ΅¬λΆ„ν•˜μ—¬ ν•œκΊΌλ²ˆμ— μ‹€ν–‰ν•˜λŠ” 것을 ν—ˆμš©ν•©λ‹ˆλ‹€. 이 곡격 λ¬Έμžμ—΄μ€ μ„Έλ―Έμ½œλ‘ μœΌλ‘œ κ΅¬λΆ„ν•œ 문에 λŒ€ν•œ 일괄 싀행을 ν—ˆμš©ν•˜μ§€ μ•ŠλŠ” Oracle 및 기타 λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œλŠ” 였λ₯˜λ₯Ό μΌμœΌν‚€μ§€λ§Œ 일괄 싀행을 ν—ˆμš©ν•˜λŠ” λ°μ΄ν„°λ² μ΄μŠ€μ—μ„œλŠ” κ³΅κ²©μžκ°€ 이런 μ’…λ₯˜μ˜ 곡격으둜 λ°μ΄ν„°λ² μ΄μŠ€μ— λŒ€ν•΄ μž„μ˜μ˜ λͺ…령을 μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ§ˆμ§€λ§‰μ˜ ν•˜μ΄ν”ˆ 쌍(--)을 λ³΄κ² μŠ΅λ‹ˆλ‹€. μ΄λŠ” λŒ€λΆ€λΆ„μ˜ λ°μ΄ν„°λ² μ΄μŠ€ μ„œλ²„μ—μ„œ ν•΄λ‹Ή 문에 λŒ€ν•œ λ‚˜λ¨Έμ§€ 뢀뢄을 μ£Όμ„μœΌλ‘œ μ²˜λ¦¬ν•˜μ—¬ μ‹€ν–‰ν•˜μ§€ λ§λΌλŠ” 의미둜 ν•΄μ„λ©λ‹ˆλ‹€[4]. 이 경우, 이 주석 λ¬ΈμžλŠ” μˆ˜μ •λœ μΏΌλ¦¬μ—μ„œ λ§ˆμ§€λ§‰μ˜ μž‘μ€λ”°μ˜΄ν‘œ ν•œμͺ½μ„ μ œκ±°ν•˜λŠ” 역할을 ν•©λ‹ˆλ‹€. 주석을 이런 μ‹μœΌλ‘œ μ‚¬μš©ν•  수 μ—†λŠ” λ°μ΄ν„°λ² μ΄μŠ€μ—μ„œλ„ Example 1μ—μ„œ λ³Έ 것과 μœ μ‚¬ν•œ μ†μž„μˆ˜λ₯Ό μ‚¬μš©ν•˜λ©΄ λŒ€λΆ€λΆ„μ˜ 곡격이 효과λ₯Ό κ±°λ‘˜ 수 μžˆμŠ΅λ‹ˆλ‹€. κ³΅κ²©μžκ°€ λ¬Έμžμ—΄ "name'); DELETE FROM items; SELECT * FROM items WHERE 'a'='a"λ₯Ό μž…λ ₯ν•˜μ—¬ λ‹€μŒ μ„Έ 가지 μœ νš¨ν•œ 문을 λ§Œλ“œλŠ” κ²½μš°μž…λ‹ˆλ‹€.


SELECT * FROM items
WHERE owner = 'wiley'
AND itemname = 'name';

DELETE FROM items;

SELECT * FROM items WHERE 'a'='a';


SubSonic injection 곡격을 λ°©μ§€ν•˜λŠ” ν•œ 가지 기쑴의 μ ‘κ·Ό 방식은 곡격을 μž…λ ₯κ°’ 검증 문제둜 μ²˜λ¦¬ν•˜κ³  μ•ˆμ „ν•œ κ°’ λͺ©λ‘(ν—ˆμš© λͺ©λ‘)의 문자만 λ°›κ±°λ‚˜ μ•…μ˜μ μΌ κ°€λŠ₯성이 μžˆλŠ” κ°’ λͺ©λ‘(κ±°λΆ€ λͺ©λ‘)을 μ‹λ³„ν•˜μ—¬ μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. ν—ˆμš© λͺ©λ‘ 검사가 μ—„κ²©ν•œ μž…λ ₯κ°’ 검증 κ·œμΉ™μ„ μ΄ν–‰ν•˜λŠ” 맀우 효율적인 μˆ˜λ‹¨μ΄ λ˜κΈ°λ„ ν•˜μ§€λ§Œ, 맀개 λ³€μˆ˜κ°€ μžˆλŠ” SubSonic 문은 μœ μ§€ 관리가 쉽고 보닀 κ°•λ ₯ν•œ λ³΄μ•ˆμ„ μ œκ³΅ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λŒ€λΆ€λΆ„μ˜ 경우 κ±°λΆ€ λͺ©λ‘ κ΅¬ν˜„μ€ SubSonic SQL injection 곡격 λ°©μ§€μ˜ 효과λ₯Ό λ–¨μ–΄λœ¨λ¦¬λŠ” ν—ˆμ μ΄ μ•„μ£Ό λ§ŽμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, κ³΅κ²©μžλŠ” λ‹€μŒκ³Ό 같이 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

- λ”°μ˜΄ν‘œλ‘œ 묢지 μ•Šμ€ ν•„λ“œλ₯Ό λ…Έλ¦½λ‹ˆλ‹€.
- μ΄μŠ€μΌ€μ΄ν”„ 처리된 메타 문자λ₯Ό μ‚¬μš©ν•  ν•„μš”κ°€ μ—†λŠ” 방법을 μ°ΎμŠ΅λ‹ˆλ‹€.
- μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λ₯Ό μ‚¬μš©ν•˜μ—¬ μ‚½μž…λœ 메타 문자λ₯Ό μˆ¨κΉλ‹ˆλ‹€.

SubSonic 쿼리에 μž…λ ₯ν•  λ•Œ μˆ˜λ™μœΌλ‘œ 문자λ₯Ό μ΄μŠ€μΌ€μ΄ν”„ μ²˜λ¦¬ν•˜λŠ” 방법도 μžˆμ§€λ§Œ μ΄κ²ƒμœΌλ‘œ SubSonic SQL injection κ³΅κ²©μœΌλ‘œλΆ€ν„° μ‘μš© ν”„λ‘œκ·Έλž¨μ„ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.

SubSonic injection 곡격을 λ‹€λ£¨λŠ” 데 주둜 μ œμ‹œλ˜λŠ” λ‹€λ₯Έ 해결책은 μ €μž₯ ν”„λ‘œμ‹œμ €(stored procedure)λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μœ ν˜•μ˜ SubSonic injection 곡격은 막을 수 μžˆμ§€λ§Œ λ‹€λ₯Έ λ§Žμ€ ν˜•μ‹μ€ 막지 λͺ»ν•©λ‹ˆλ‹€. μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일반적으둜 맀개 λ³€μˆ˜μ— μ „λ‹¬λ˜λŠ” ν•΄λ‹Ή 문의 ν˜•μ‹μ„ μ œν•œν•˜μ—¬ SubSonic SQL injection 곡격을 λ§‰μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 μ œμ•½μ„ ν”Όν•  수 μžˆλŠ” λ§Žμ€ 방법이 μžˆμ–΄ μˆ˜λ§Žμ€ 비정상적인 문을 μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)에 전달할 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν’€μ΄ν•˜μ§€λ§Œ, μ €μž₯ ν”„λ‘œμ‹œμ €(Stored procedure)λŠ” 일뢀 μ΅μŠ€ν”Œλ‘œμ΄νŠΈλŠ” 막을 수 μžˆμ§€λ§Œ μ‘μš© ν”„λ‘œκ·Έλž¨μ„ SubSonic injection 곡격에 λŒ€ν•΄ μ•ˆμ „ν•˜κ²Œ λ³΄ν˜Έν•  μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€.
References
[1] S. J. Friedl SQL Injection Attacks by Example
[2] P. Litwin Stop SQL Injection Attacks Before They Stop You MSDN Magazine
[3] P. Finnigan SQL Injection and Oracle, Part One Security Focus
[4] M. Howard, D. LeBlanc Writing Secure Code, Second Edition Microsoft Press
[5] Standards Mapping - Common Weakness Enumeration CWE ID 89
[6] Standards Mapping - Common Weakness Enumeration Top 25 2019 [6] CWE ID 089
[7] Standards Mapping - Common Weakness Enumeration Top 25 2020 [6] CWE ID 089
[8] Standards Mapping - Common Weakness Enumeration Top 25 2021 [6] CWE ID 089
[9] Standards Mapping - Common Weakness Enumeration Top 25 2022 [3] CWE ID 089
[10] Standards Mapping - Common Weakness Enumeration Top 25 2023 [3] CWE ID 089
[11] Standards Mapping - Common Weakness Enumeration Top 25 2024 [3] CWE ID 089
[12] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001310, CCI-002754
[13] Standards Mapping - FIPS200 SI
[14] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[15] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[16] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[17] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.3.4 Output Encoding and Injection Prevention Requirements (L1 L2 L3), 5.3.5 Output Encoding and Injection Prevention Requirements (L1 L2 L3)
[18] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[19] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-CODE-4, MASVS-PLATFORM-1
[20] Standards Mapping - OWASP Top 10 2004 A6 Injection Flaws
[21] Standards Mapping - OWASP Top 10 2007 A2 Injection Flaws
[22] Standards Mapping - OWASP Top 10 2010 A1 Injection
[23] Standards Mapping - OWASP Top 10 2013 A1 Injection
[24] Standards Mapping - OWASP Top 10 2017 A1 Injection
[25] Standards Mapping - OWASP Top 10 2021 A03 Injection
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1, Requirement 6.5.2
[28] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[29] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[30] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[31] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[32] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[33] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[34] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[35] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[36] 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
[37] 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
[38] Standards Mapping - SANS Top 25 2009 Insecure Interaction - CWE ID 089
[39] Standards Mapping - SANS Top 25 2010 Insecure Interaction - CWE ID 089
[40] Standards Mapping - SANS Top 25 2011 Insecure Interaction - CWE ID 089
[41] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[42] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[43] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[44] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I, APP3540.1 CAT I, APP3540.3 CAT II
[48] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[50] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[51] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[52] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[53] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[54] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[55] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[56] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[57] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[58] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[59] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[60] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[61] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[62] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[63] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002540 CAT I, APSC-DV-002560 CAT I
[64] Standards Mapping - Web Application Security Consortium Version 2.00 SQL Injection (WASC-19)
[65] Standards Mapping - Web Application Security Consortium 24 + 2 SQL Injection
desc.dataflow.dotnet.sql_injection_subsonic
Abstract
λŒ€μƒ SSH μ„œλ²„μ—λŠ” 인증이 ν•„μš”ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
Explanation
λ―Όκ°ν•œ 정보가 ν¬ν•¨λ˜μ–΄ μžˆκ±°λ‚˜ 원격 관리 νŒ¨λ„ 같은 κΆŒν•œμ΄ μ§€μ •λœ κΈ°λŠ₯이 ν¬ν•¨λ˜μ–΄ μžˆλŠ” μ„œλ²„λŠ” μ•‘μ„ΈμŠ€λ₯Ό μœ„ν•œ 인증을 μš”κ΅¬ν•΄μ•Ό ν•©λ‹ˆλ‹€. 그렇지 μ•ŠμœΌλ©΄ κ³΅κ²©μžκ°€ κ°„λ‹¨νžˆ 일반 μ‚¬μš©μž 이름을 μΆ”μΈ‘ν•˜λŠ” κ²ƒλ§ŒμœΌλ‘œ λ―Όκ°ν•œ 정보λ₯Ό ν›”μΉ˜κ±°λ‚˜ λŒ€μƒ 호슀트λ₯Ό μ œμ–΄ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

ν΄λΌμ΄μ–ΈνŠΈλŠ” NoneAuth 인증 λ©”μ„œλ“œλ₯Ό μ‚¬μš©ν•˜μ—¬ μ‚¬μš© κ°€λŠ₯ν•œ 인증 λ©”μ„œλ“œλ₯Ό κ²°μ •ν•©λ‹ˆλ‹€.

예제 1: λ‹€μŒ Paramiko μ½”λ“œλŠ” "μ—†μŒ" 인증 μš”μ²­μ„ μ‚¬μš©ν•˜μ—¬ μ„œλ²„ 인증을 μ‹œλ„ν•©λ‹ˆλ‹€.


client = SSHClient()
client.connect(host, port, auth_strategy=NoneAuth("user"))
References
[1] IETF RFC 4252 - "none" Authentication Request IETF
[2] Paramiko Authentication Module "NoneAuth" Paramiko
[3] Standards Mapping - Common Weakness Enumeration CWE ID 306
[4] Standards Mapping - Common Weakness Enumeration Top 25 2019 [13] CWE ID 287
[5] Standards Mapping - Common Weakness Enumeration Top 25 2020 [14] CWE ID 287, [24] CWE ID 306
[6] Standards Mapping - Common Weakness Enumeration Top 25 2021 [11] CWE ID 306, [14] CWE ID 287
[7] Standards Mapping - Common Weakness Enumeration Top 25 2022 [14] CWE ID 287, [18] CWE ID 306
[8] Standards Mapping - Common Weakness Enumeration Top 25 2023 [13] CWE ID 287, [20] CWE ID 306
[9] Standards Mapping - Common Weakness Enumeration Top 25 2024 [14] CWE ID 287, [25] CWE ID 306
[10] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-000213, CCI-000804, CCI-001084, CCI-002165
[11] Standards Mapping - FIPS200 IA
[12] Standards Mapping - General Data Protection Regulation (GDPR) Access Violation
[13] Standards Mapping - NIST Special Publication 800-53 Revision 4 AC-3 Access Enforcement (P1), IA-2 Identification and Authentication (Organizational Users) (P1), IA-8 Identification and Authentication (Non-Organizational Users) (P1), IA-11 Re-Authentication (P0), SC-3 Security Function Isolation (P1)
[14] Standards Mapping - NIST Special Publication 800-53 Revision 5 AC-3 Access Enforcement, IA-2 Identification and Authentication (Organizational Users), IA-8 Identification and Authentication (Non-Organizational Users), SC-3 Security Function Isolation, SC-11 Trusted Path
[15] Standards Mapping - OWASP API 2023 API2 Broken Authentication
[16] Standards Mapping - OWASP Application Security Verification Standard 4.0 1.2.2 Authentication Architectural Requirements (L2 L3), 1.2.3 Authentication Architectural Requirements (L2 L3), 1.2.4 Authentication Architectural Requirements (L2 L3), 2.7.1 Out of Band Verifier Requirements (L1 L2 L3), 2.7.2 Out of Band Verifier Requirements (L1 L2 L3), 2.7.3 Out of Band Verifier Requirements (L1 L2 L3), 2.8.4 Single or Multi Factor One Time Verifier Requirements (L2 L3), 2.8.5 Single or Multi Factor One Time Verifier Requirements (L2 L3), 3.7.1 Defenses Against Session Management Exploits (L1 L2 L3), 9.2.3 Server Communications Security Requirements (L2 L3), 14.5.4 Validate HTTP Request Header Requirements (L1 L2 L3)
[17] Standards Mapping - OWASP Mobile 2014 M5 Poor Authorization and Authentication
[18] Standards Mapping - OWASP Mobile 2024 M3 Insecure Authentication/Authorization
[19] Standards Mapping - OWASP Top 10 2004 A3 Broken Authentication and Session Management
[20] Standards Mapping - OWASP Top 10 2007 A7 Broken Authentication and Session Management
[21] Standards Mapping - OWASP Top 10 2010 A3 Broken Authentication and Session Management
[22] Standards Mapping - OWASP Top 10 2013 A2 Broken Authentication and Session Management
[23] Standards Mapping - OWASP Top 10 2017 A2 Broken Authentication
[24] Standards Mapping - OWASP Top 10 2021 A07 Identification and Authentication Failures
[25] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.2
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.8
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.8
[28] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.8
[29] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.8
[30] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[31] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[32] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 5.4 - Authentication and Access Control
[33] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 5.4 - Authentication and Access Control
[34] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 5.3 - Authentication and Access Control, Control Objective C.2.1.2 - Web Software Access Controls
[35] Standards Mapping - SANS Top 25 2009 Porous Defenses - CWE ID 285
[36] Standards Mapping - SANS Top 25 2010 Porous Defenses - CWE ID 285
[37] Standards Mapping - SANS Top 25 2011 Porous Defenses - CWE ID 306
[38] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3480.1 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3480.1 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3480.1 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3480.1 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3480.1 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3480.1 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[48] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[49] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[50] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[51] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[52] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[53] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[54] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[55] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[56] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[57] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001520 CAT II, APSC-DV-001530 CAT II, APSC-DV-001540 CAT I, APSC-DV-001610 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[58] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001520 CAT II, APSC-DV-001530 CAT II, APSC-DV-001540 CAT I, APSC-DV-001610 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[59] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001520 CAT II, APSC-DV-001530 CAT II, APSC-DV-001540 CAT I, APSC-DV-001610 CAT II, APSC-DV-001870 CAT II, APSC-DV-002360 CAT II
[60] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Authentication (WASC-01)
[61] Standards Mapping - Web Application Security Consortium 24 + 2 Insufficient Authentication
desc.structural.python.ssh_misconfiguration_missing_authentication
Abstract
μ μ ˆν•œ λ¬Έμžμ—΄ μ’…λ£Œλ₯Ό μ‚¬μš©ν•˜λ©΄ buffer overflowκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.
Explanation
String termination errorλŠ” λ‹€μŒ κ²½μš°μ— λ°œμƒν•©λ‹ˆλ‹€.

1. 데이터가 좜λ ₯을 null둜 끝내지 μ•ŠλŠ” ν•¨μˆ˜λ₯Ό 톡해 ν”„λ‘œκ·Έλž¨μ— μž…λ ₯λ©λ‹ˆλ‹€.

2. μž…λ ₯을 null둜 끝내야 ν•˜λŠ” ν•¨μˆ˜μ— 데이터λ₯Ό μ „λ‹¬ν•©λ‹ˆλ‹€.
예제 1: λ‹€μŒ μ½”λ“œλŠ” cfgfileμ—μ„œ 읽어 strcpy()λ₯Ό μ‚¬μš©ν•˜μ—¬ μž…λ ₯을 inputbuf에 λ³΅μ‚¬ν•©λ‹ˆλ‹€. μ½”λ“œλŠ” inputbuf에 항상 null μ’…κ²°μžκ°€ μžˆλ‹€κ³  잘λͺ» κ°€μ •ν•©λ‹ˆλ‹€.


#define MAXLEN 1024
...
char *pathbuf[MAXLEN];
...
read(cfgfile,inputbuf,MAXLEN); //does not null-terminate
strcpy(pathbuf,inputbuf); //requires null-terminated input
...
Example 1의 μ½”λ“œλŠ” cfgfileμ—μ„œ 읽은 데이터가 μ˜ˆμƒλŒ€λ‘œ λ””μŠ€ν¬μ—μ„œ null둜 λλ‚˜λ©΄ μ •ν™•ν•˜κ²Œ λ™μž‘ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ κ³΅κ²©μžκ°€ 이 μž…λ ₯을 μ˜ˆμƒν•˜λŠ” null 문자λ₯Ό ν¬ν•¨ν•˜μ§€ μ•Šλ„λ‘ μˆ˜μ •ν•  수 μžˆλ‹€λ©΄ strcpy() ν˜ΈμΆœμ€ μž„μ˜μ˜ null 문자λ₯Ό λ§Œλ‚  λ•ŒκΉŒμ§€ 계속 λ©”λͺ¨λ¦¬μ—μ„œ λ³΅μ‚¬ν•©λ‹ˆλ‹€. μ΄λŠ” λŒ€μƒ 버퍼에 μ˜€λ²„ν”Œλ‘œλ₯Ό μΌμœΌν‚¬ κ°€λŠ₯성이 크며, κ³΅κ²©μžκ°€ inputbuf λ°”λ‘œ λ‹€μŒμ˜ λ©”λͺ¨λ¦¬ λ‚΄μš©μ„ μ œμ–΄ν•  수 있게 되면 μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ buffer overflow 곡격에 μ·¨μ•½ν•΄μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€.

예제 2: λ‹€μŒ μ½”λ“œμ—μ„œ readlink()λŠ” 버퍼 path에 μ €μž₯된 심볼 링크의 이름을 ν™•μž₯ν•˜μ—¬ 심볼 λ§ν¬μ—μ„œ μ°Έμ‘°ν•˜λŠ” 파일의 μ ˆλŒ€ κ²½λ‘œκ°€ 버퍼 buf에 ν¬ν•¨λ˜λ„λ‘ ν•©λ‹ˆλ‹€. 그런 λ‹€μŒ, κ²°κ³Ό κ°’μ˜ 길이λ₯Ό strlen()을 μ‚¬μš©ν•˜μ—¬ κ³„μ‚°ν•©λ‹ˆλ‹€.


...
char buf[MAXPATH];
...
readlink(path, buf, MAXPATH);
int length = strlen(buf);
...
Example 2의 μ½”λ“œλŠ” readlink()λ₯Ό 톡해 buf둜 읽은 값이 null둜 λλ‚˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμ— μ˜¬λ°”λ‘œ λ™μž‘ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. ν…ŒμŠ€νŠΈμ—μ„œ buf 및 버퍼 λ°”λ‘œ λ‹€μŒ λ©”λͺ¨λ¦¬μ˜ μ‚¬μš©λ˜μ§€ μ•ŠλŠ” λ‚΄μš©μ΄ null일 수 있기 λ•Œλ¬Έμ— 이런 취약점을 λ°œκ²¬ν•˜μ§€ λͺ»ν•  수 μžˆμœΌλ―€λ‘œ strlen()이 μ˜¬λ°”λ‘œ λ™μž‘ν•˜λŠ” κ²ƒμ²˜λŸΌ λ³΄μž…λ‹ˆλ‹€. ν•˜μ§€λ§Œ, μ‹€μ œ μƒν™©μ—μ„œλŠ” strlen()이 μŠ€νƒμ—μ„œ μž„μ˜μ˜ null 문자λ₯Ό λ°œκ²¬ν•  λ•ŒκΉŒμ§€ 계속 λ©”λͺ¨λ¦¬λ₯Ό νƒμƒ‰ν•˜κΈ° λ•Œλ¬Έμ— κ²°κ΅­ buf의 크기보닀 훨씬 큰 length 값이 λ°œμƒν•˜κ³  이후에 이 값을 μ‚¬μš©ν•˜λ©΄ buffer overflowκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

예제 3: λ‹€μŒ μ½”λ“œλŠ” snprintf()λ₯Ό μ‚¬μš©ν•˜μ—¬ μ‚¬μš©μž μž…λ ₯ λ¬Έμžμ—΄μ„ λ³΅μ‚¬ν•˜κ³  μ—¬λŸ¬ 좜λ ₯ λ¬Έμžμ—΄μ— λ„£μŠ΅λ‹ˆλ‹€. sprintf()와 λΉ„κ΅ν•˜μ—¬ μΆ”κ°€ κ°€λ“œλ ˆμΌ, 특히 μ΅œλŒ€ 좜λ ₯ 크기의 지정을 μ œκ³΅ν•¨μ—λ„ λΆˆκ΅¬ν•˜κ³  snprintf() ν•¨μˆ˜λŠ” μ§€μ •λœ 좜λ ₯ 크기가 μ˜ˆμƒ μž…λ ₯보닀 큰 경우 μ—¬μ „νžˆ λ¬Έμžμ—΄ μ’…λ£Œ 였λ₯˜κ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€. λ¬Έμžμ—΄ μ’…λ£Œ 였λ₯˜λŠ” λ©”λͺ¨λ¦¬ λˆ„μˆ˜ λ˜λŠ” buffer overflow와 같은 λ‹€μš΄μŠ€νŠΈλ¦Ό 문제둜 μ΄μ–΄μ§ˆ 수 μžˆμŠ΅λ‹ˆλ‹€.


...
char no_null_term[5] = getUserInput();

char output_1[20];
snprintf(output_1, 20, "%s", no_null_term);

char output_2[20];
snprintf(output_2, 20, "%s", no_null_term);


printf("%s\n", output_1);
printf("%s\n", output_2);
...
Example 3의 μ½”λ“œλŠ” λ©”λͺ¨λ¦¬ λˆ„μˆ˜λ₯Ό λ³΄μ—¬μ€λ‹ˆλ‹€. output_2κ°€ no_null_term으둜 μ±„μ›Œμ§„ 경우 snprintf()λŠ” null λ¬Έμžκ°€ λ‚˜νƒ€λ‚˜κ±°λ‚˜ μ§€μ •λœ 크기 μ œν•œμ— 도달할 λ•ŒκΉŒμ§€ no_null_term μœ„μΉ˜μ—μ„œ 읽어야 ν•©λ‹ˆλ‹€. no_null_termμ—μ„œ μ’…λ£Œ λ¬Έμžκ°€ μ—†μœΌλ―€λ‘œ snprintfλŠ” κ²°κ΅­ snprintf()의 첫 번째 ν˜ΈμΆœμ—μ„œ μ œκ³΅λ˜λŠ” null둜 μ’…λ£Œλ˜λŠ” λ¬Έμžμ— λ„λ‹¬ν•˜λŠ” output_1의 데이터λ₯Ό κ³„μ†ν•΄μ„œ μ½μŠ΅λ‹ˆλ‹€. λ©”λͺ¨λ¦¬ λˆ„μˆ˜λŠ” output_2의 printf()μ—μ„œ 보여 μ£Όλ©°, μ—¬κΈ°μ—λŠ” no_null_term의 문자 μ‹œν€€μŠ€κ°€ 두 번 ν¬ν•¨λ©λ‹ˆλ‹€.

μ „ν†΅μ μœΌλ‘œ λ¬Έμžμ—΄μ€ null 문자둜 λλ‚˜λŠ” 데이터λ₯Ό ν¬ν•¨ν•œ λ©”λͺ¨λ¦¬μ˜ ν•œ λΆ€λΆ„μœΌλ‘œ ν‘œν˜„ν•©λ‹ˆλ‹€. 이전 λ¬Έμžμ—΄ 처리 λ©”μ„œλ“œλŠ” 자주 이 null 문자λ₯Ό μ‚¬μš©ν•˜μ—¬ λ¬Έμžμ—΄ 길이λ₯Ό κ²°μ •ν•©λ‹ˆλ‹€. null μ’…κ²°μžκ°€ μ—†λŠ” 버퍼가 이 ν•¨μˆ˜ 쀑 ν•˜λ‚˜λ‘œ 전달될 경우, ν•΄λ‹Ή ν•¨μˆ˜λŠ” λ²„νΌμ˜ 끝을 μ§€λ‚˜ 계속 μ½μŠ΅λ‹ˆλ‹€.

μ•…μ˜μ μΈ μ‚¬μš©μžλŠ” 보톡 예기치 λͺ»ν•œ ν¬κΈ°λ‚˜ λ‚΄μš©μ˜ 데이터λ₯Ό μ‘μš© ν”„λ‘œκ·Έλž¨μ— μ‚½μž…ν•˜μ—¬ 이런 μœ ν˜•μ˜ 취약점을 μ΅μŠ€ν”Œλ‘œμ΄νŠΈν•©λ‹ˆλ‹€. μ•…μ„± μž…λ ₯을 ν”„λ‘œκ·Έλž¨ μž…λ ₯으둜 μ§μ ‘μ μœΌλ‘œ μ œκ³΅ν•˜κ±°λ‚˜ ꡬ성 파일과 같은 μ‘μš© ν”„λ‘œκ·Έλž¨ λ¦¬μ†ŒμŠ€λ₯Ό μˆ˜μ •ν•˜μ—¬ κ°„μ ‘μ μœΌλ‘œ μ œκ³΅ν•©λ‹ˆλ‹€. κ³΅κ²©μžκ°€ μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ 버퍼 λ²”μœ„λ₯Ό λ„˜μ–΄μ„œ 읽도둝 λ§Œλ“œλŠ” 경우 κ³΅κ²©μžλŠ” κ·Έ 결과둜 λ°œμƒν•˜λŠ” buffer overflowλ₯Ό μ΄μš©ν•˜μ—¬ μ‹œμŠ€ν…œμ— μž„μ˜μ˜ μ½”λ“œλ₯Ό μ‚½μž…ν•˜μ—¬ μ‹€ν–‰ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.
References
[1] M. Howard, D. LeBlanc Writing Secure Code, Second Edition Microsoft Press
[2] Standards Mapping - Common Weakness Enumeration CWE ID 170, CWE ID 665
[3] Standards Mapping - Common Weakness Enumeration Top 25 2024 [12] CWE ID 020
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754, CCI-002824
[5] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[6] Standards Mapping - Motor Industry Software Reliability Association (MISRA) C Guidelines 2012 Rule 1.3
[7] Standards Mapping - Motor Industry Software Reliability Association (MISRA) C Guidelines 2023 Directive 4.14, Rule 1.3, Rule 21.17
[8] Standards Mapping - Motor Industry Software Reliability Association (MISRA) C++ Guidelines 2008 Rule 0-3-1
[9] Standards Mapping - Motor Industry Software Reliability Association (MISRA) C++ Guidelines 2023 Rule 4.1.3
[10] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1), SI-16 Memory Protection (P1)
[11] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation, SI-16 Memory Protection
[12] Standards Mapping - OWASP Mobile 2024 M4 Insufficient Input/Output Validation
[13] Standards Mapping - OWASP Mobile Application Security Verification Standard 2.0 MASVS-CODE-4
[14] Standards Mapping - OWASP Top 10 2004 A5 Buffer Overflow
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.5
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.2
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.2
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.2
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.2
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.2
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[25] 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
[26] 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
[27] Standards Mapping - SANS Top 25 2009 Risky Resource Management - CWE ID 665
[28] Standards Mapping - SANS Top 25 2010 Risky Resource Management - CWE ID 665
[29] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I, APP3590.1 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I, APP3590.1 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I, APP3590.1 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I, APP3590.1 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I, APP3590.1 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I, APP3590.1 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I, APP3590.1 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[47] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[48] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[50] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[51] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I, APSC-DV-002590 CAT I
[52] Standards Mapping - Web Application Security Consortium Version 2.00 Buffer Overflow (WASC-07)
[53] Standards Mapping - Web Application Security Consortium 24 + 2 Buffer Overflow
desc.dataflow.cpp.string_termination_error.master
Abstract
Struts 2.x Action은 κ³΅κ²©μžκ°€ μž„μ˜ 데이터λ₯Ό μ„Έμ…˜, μ‘μš© ν”„λ‘œκ·Έλž¨ λ˜λŠ” μš”μ²­ μ„œλ²„ μͺ½ κ°œμ²΄μ— λ°”μΈλ”©ν•¨μœΌλ‘œμ¨ μ‘μš© ν”„λ‘œκ·Έλž¨ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ μˆ˜μ •ν•  수 μžˆλ„λ‘ ν•˜λŠ” 클래슀λ₯Ό κ΅¬ν˜„ν•©λ‹ˆλ‹€.
Explanation
Apache Struts 2.xμ—λŠ” κ°œλ°œμžκ°€ Actions μ½”λ“œμ— κ΄€λ ¨ λŸ°νƒ€μž„ 정보가 ν¬ν•¨λœ 맡을 μ‰½κ²Œ μ‚½μž…ν•  수 μžˆλŠ” μƒˆλ‘œμš΄ Aware μΈν„°νŽ˜μ΄μŠ€κ°€ ν¬ν•¨λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€λ‘œλŠ” org.apache.struts2.interceptor.ApplicationtAware, org.apache.struts2.interceptor.SessionAware 및 org.apache.struts2.interceptor.RequestAwareκ°€ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 데이터 맡을 μžμ‹ μ΄ κ°œλ°œν•œ Actions μ½”λ“œμ— μ‚½μž…ν•˜λ €λŠ” κ°œλ°œμžλŠ” μΈν„°νŽ˜μ΄μŠ€μ— μ§€μ •λœ setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•©λ‹ˆλ‹€(예: SessionAware μΈν„°νŽ˜μ΄μŠ€μ˜ 경우 setSession).

public class VulnerableAction extends ActionSupport implements SessionAware {

protected Map<String, Object> session;

@Override
public void setSession(Map<String, Object> session) {
this.session = session;
}

반면 Struts 2.xλŠ” Action에 μ •μ˜λœ 곡용 μ ‘κ·Όμžλ₯Ό 톡해 μ‚¬μš©μžλ‘œλΆ€ν„° μ œκ³΅λ˜λŠ” μš”μ²­ 데이터λ₯Ό Action의 속성에 μžλ™μœΌλ‘œ λ°”μΈλ”©ν•©λ‹ˆλ‹€. Aware μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ‚¬μš©ν•˜λ €λ©΄ Aware μΈν„°νŽ˜μ΄μŠ€μ— μ •μ˜λœ 곡용 setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•˜λ©°, 이 setter 도 Aware μΈν„°νŽ˜μ΄μŠ€ setter 이름과 μΌμΉ˜ν•˜λŠ” λͺ¨λ“  μš”μ²­ 맀개 λ³€μˆ˜μ— μžλ™μœΌλ‘œ λ°”μΈλ”©λ©λ‹ˆλ‹€. 이 λ™μž‘μœΌλ‘œ 인해 SessionAware, RequestAware, ApplicationAware μΈν„°νŽ˜μ΄μŠ€μ—μ„œ 보여 μ€€ κ²ƒμ²˜λŸΌ 원격 κ³΅κ²©μžκ°€ 영ν–₯을 λ°›λŠ” μΈν„°νŽ˜μ΄μŠ€λ₯Ό κ΅¬ν˜„ν•œ μ‘μš© ν”„λ‘œκ·Έλž¨μ— μ‘°μž‘λœ 맀개 λ³€μˆ˜λ₯Ό μ œκ³΅ν•˜μ—¬ λŸ°νƒ€μž„ 데이터 값을 μˆ˜μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ URL을 톡해 κ³΅κ²©μžκ°€ μ„Έμ…˜ λ§΅μ—μ„œ "roles" 속성을 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 κ³΅κ²©μžκ°€ κ΄€λ¦¬μžκ°€ 될 μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

http://server/VulnerableAction?session.roles=admin


μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€μ—μ„œλŠ” setter μ ‘κ·Όμž κ΅¬ν˜„λ§Œ μš”κ΅¬ν•˜μ§€λ§Œ ν•΄λ‹Ήν•˜λŠ” getter 도 κ΅¬ν˜„ν•œ 경우 μ΄λŸ¬ν•œ 맡 μ»¬λ ‰μ…˜ λ³€κ²½ 사항은 ν˜„μž¬ μš”μ²­ λ²”μœ„μ—λ§Œ μ μš©λ˜λŠ” 것이 μ•„λ‹ˆλΌ μ„Έμ…˜ λ²”μœ„ λ‚΄μ—μ„œ μ§€μ†λ©λ‹ˆλ‹€.
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 20
[2] Standards Mapping - Common Weakness Enumeration Top 25 2021 [4] CWE ID 020
[3] Standards Mapping - Common Weakness Enumeration Top 25 2022 [4] CWE ID 020
[4] Standards Mapping - Common Weakness Enumeration Top 25 2023 [6] CWE ID 020
[5] Standards Mapping - Common Weakness Enumeration Top 25 2024 [12] CWE ID 020
[6] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001082, CCI-002754
[7] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[8] Standards Mapping - NIST Special Publication 800-53 Revision 4 SC-2 Application Partitioning (P1), SI-10 Information Input Validation (P1)
[9] Standards Mapping - NIST Special Publication 800-53 Revision 5 SC-2 Separation of System and User Functionality, SI-10 Information Input Validation
[10] Standards Mapping - OWASP API 2023 API3 Broken Object Property Level Authorization
[11] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.1.3 Input Validation Requirements (L1 L2 L3), 5.1.4 Input Validation Requirements (L1 L2 L3)
[12] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[13] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[14] Standards Mapping - OWASP Top 10 2007 A4 Insecure Direct Object Reference
[15] Standards Mapping - OWASP Top 10 2010 A4 Insecure Direct Object References
[16] Standards Mapping - OWASP Top 10 2013 A4 Insecure Direct Object References
[17] Standards Mapping - OWASP Top 10 2017 A5 Broken Access Control
[18] Standards Mapping - OWASP Top 10 2021 A03 Injection
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.5.2
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[24] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[25] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[28] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[29] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection
[30] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection
[31] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[47] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Process Validation (WASC-40)
desc.structural.java.struts2_bad_practices_application_map_tampering
Abstract
Struts 2 Actionμ—μ„œλŠ” μ΅œμ’… μ‚¬μš©μžκ°€ ν˜ΈμΆœν•˜μ—¬ Action의 execute() λ©”μ„œλ“œλ₯Ό μ˜€λ²„λΌμ΄λ“œν•  수 μžˆλŠ” public λ©”μ„œλ“œλ₯Ό λ…ΈμΆœν•©λ‹ˆλ‹€.
Explanation
Struts 2μ—λŠ” Actionμ—μ„œ execute() μ΄μ™Έμ˜ λ©”μ„œλ“œλ₯Ό λ…ΈμΆœν•  수 μžˆλ„λ‘ ν•˜λŠ” "동적 λ©”μ„œλ“œ 호좜"μ΄λΌλŠ” κΈ°λŠ₯이 λ„μž…λ˜μ—ˆμŠ΅λ‹ˆλ‹€. "동적 λ©”μ„œλ“œ 호좜"이 ν™œμ„±ν™”λœ 경우 Action URL에 !(λŠλ‚Œν‘œ) 문자 λ˜λŠ” method: 접두사λ₯Ό μ‚¬μš©ν•˜μ—¬ Action의 λͺ¨λ“  public λ©”μ„œλ“œλ₯Ό ν˜ΈμΆœν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 κΈ°λŠ₯을 μ•Œμ§€ λͺ»ν•˜λŠ” κ°œλ°œμžλŠ” λ‚΄λΆ€ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ κ³΅κ²©μžμ—κ²Œ μ‹€μˆ˜λ‘œ λ…ΈμΆœν•  수 μžˆμŠ΅λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ 인수λ₯Ό μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” getUserPassword()λΌλŠ” public λ©”μ„œλ“œκ°€ ν¬ν•¨λœ Actionμ—μ„œ "동적 λ©”μ„œλ“œ 호좜" κΈ°λŠ₯을 λΉ„ν™œμ„±ν™”ν•˜μ§€ λͺ»ν•˜λ©΄ κ³΅κ²©μžκ°€ λ‹€μŒ URL을 λ°©λ¬Έν•˜μ—¬ ν•΄λ‹Ή κΈ°λŠ₯을 μ΄μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. http://server/app/recoverpassword!getPassword.action
References
[1] Struts 2 Security Vulnerability - Dynamic Method Invocation
[2] Struts 2 - Dynamic Method Invocation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 285
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-000213, CCI-001764, CCI-001774, CCI-002165
[5] Standards Mapping - FIPS200 AC
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 AC-3 Access Enforcement (P1), CM-7 Least Functionality (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 AC-3 Access Enforcement, CM-7 Least Functionality
[9] Standards Mapping - OWASP API 2023 API5 Broken Function Level Authorization
[10] Standards Mapping - OWASP Application Security Verification Standard 4.0 4.1.3 General Access Control Design (L1 L2 L3), 4.1.5 General Access Control Design (L1 L2 L3), 4.2.1 Operation Level Access Control (L1 L2 L3), 13.1.4 Generic Web Service Security Verification Requirements (L2 L3)
[11] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[12] Standards Mapping - OWASP Top 10 2004 A2 Broken Access Control
[13] Standards Mapping - OWASP Top 10 2007 A4 Insecure Direct Object Reference
[14] Standards Mapping - OWASP Top 10 2010 A4 Insecure Direct Object References
[15] Standards Mapping - OWASP Top 10 2013 A4 Insecure Direct Object References
[16] Standards Mapping - OWASP Top 10 2017 A5 Broken Access Control
[17] Standards Mapping - OWASP Top 10 2021 A01 Broken Access Control
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.2
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.5.4
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.8
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.8
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.8
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.8
[24] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.8
[25] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[27] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 5.4 - Authentication and Access Control
[28] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 5.4 - Authentication and Access Control
[29] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 5.4 - Authentication and Access Control, Control Objective C.2.3 - Web Software Access Controls
[30] Standards Mapping - SANS Top 25 2009 Porous Defenses - CWE ID 285
[31] Standards Mapping - SANS Top 25 2010 Porous Defenses - CWE ID 285
[32] Standards Mapping - SANS Top 25 2011 Porous Defenses - CWE ID 862
[33] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[41] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[42] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[43] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[44] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[45] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[46] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[47] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[48] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[49] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[50] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[51] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[52] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[53] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[54] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[55] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-000460 CAT I, APSC-DV-000470 CAT II, APSC-DV-001480 CAT II, APSC-DV-001490 CAT II
[56] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Authorization (WASC-02)
[57] Standards Mapping - Web Application Security Consortium 24 + 2 Insufficient Authorization
desc.structural.java.struts2_bad_practices_dynamic_method_invocation
Abstract
Struts 2.x Action은 κ³΅κ²©μžκ°€ μž„μ˜ 데이터λ₯Ό μ„Έμ…˜, μ‘μš© ν”„λ‘œκ·Έλž¨ λ˜λŠ” μš”μ²­ μ„œλ²„ μͺ½ κ°œμ²΄μ— λ°”μΈλ”©ν•¨μœΌλ‘œμ¨ μ‘μš© ν”„λ‘œκ·Έλž¨ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ μˆ˜μ •ν•  수 μžˆλ„λ‘ ν•˜λŠ” 클래슀λ₯Ό κ΅¬ν˜„ν•©λ‹ˆλ‹€.
Explanation
Apache Struts 2.xμ—λŠ” κ°œλ°œμžκ°€ Actions μ½”λ“œμ— κ΄€λ ¨ λŸ°νƒ€μž„ 정보가 ν¬ν•¨λœ 맡을 μ‰½κ²Œ μ‚½μž…ν•  수 μžˆλŠ” μƒˆλ‘œμš΄ Aware μΈν„°νŽ˜μ΄μŠ€κ°€ ν¬ν•¨λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€λ‘œλŠ” org.apache.struts2.interceptor.ApplicationtAware, org.apache.struts2.interceptor.SessionAware 및 org.apache.struts2.interceptor.RequestAwareκ°€ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 데이터 맡을 μžμ‹ μ΄ κ°œλ°œν•œ Actions μ½”λ“œμ— μ‚½μž…ν•˜λ €λŠ” κ°œλ°œμžλŠ” μΈν„°νŽ˜μ΄μŠ€μ— μ§€μ •λœ setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•©λ‹ˆλ‹€(예: SessionAware μΈν„°νŽ˜μ΄μŠ€μ˜ 경우 setSession).

public class VulnerableAction extends ActionSupport implements SessionAware {

protected Map<String, Object> session;

@Override
public void setSession(Map<String, Object> session) {
this.session = session;
}

반면 Struts 2.xλŠ” Action에 μ •μ˜λœ 곡용 μ ‘κ·Όμžλ₯Ό 톡해 μ‚¬μš©μžλ‘œλΆ€ν„° μ œκ³΅λ˜λŠ” μš”μ²­ 데이터λ₯Ό Action의 속성에 μžλ™μœΌλ‘œ λ°”μΈλ”©ν•©λ‹ˆλ‹€. Aware μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ‚¬μš©ν•˜λ €λ©΄ Aware μΈν„°νŽ˜μ΄μŠ€μ— μ •μ˜λœ 곡용 setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•˜λ©°, 이 setter 도 Aware μΈν„°νŽ˜μ΄μŠ€ setter 이름과 μΌμΉ˜ν•˜λŠ” λͺ¨λ“  μš”μ²­ 맀개 λ³€μˆ˜μ— μžλ™μœΌλ‘œ λ°”μΈλ”©λ©λ‹ˆλ‹€. 이 λ™μž‘μœΌλ‘œ 인해 SessionAware, RequestAware, ApplicationAware μΈν„°νŽ˜μ΄μŠ€μ—μ„œ 보여 μ€€ κ²ƒμ²˜λŸΌ 원격 κ³΅κ²©μžκ°€ 영ν–₯을 λ°›λŠ” μΈν„°νŽ˜μ΄μŠ€λ₯Ό κ΅¬ν˜„ν•œ μ‘μš© ν”„λ‘œκ·Έλž¨μ— μ‘°μž‘λœ 맀개 λ³€μˆ˜λ₯Ό μ œκ³΅ν•˜μ—¬ λŸ°νƒ€μž„ 데이터 값을 μˆ˜μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ URL을 톡해 κ³΅κ²©μžκ°€ μ„Έμ…˜ λ§΅μ—μ„œ "roles" 속성을 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 κ³΅κ²©μžκ°€ κ΄€λ¦¬μžκ°€ 될 μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

http://server/VulnerableAction?session.roles=admin


μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€μ—μ„œλŠ” setter μ ‘κ·Όμž κ΅¬ν˜„λ§Œ μš”κ΅¬ν•˜μ§€λ§Œ ν•΄λ‹Ήν•˜λŠ” getter 도 κ΅¬ν˜„ν•œ 경우 μ΄λŸ¬ν•œ 맡 μ»¬λ ‰μ…˜ λ³€κ²½ 사항은 ν˜„μž¬ μš”μ²­ λ²”μœ„μ—λ§Œ μ μš©λ˜λŠ” 것이 μ•„λ‹ˆλΌ μ„Έμ…˜ λ²”μœ„ λ‚΄μ—μ„œ μ§€μ†λ©λ‹ˆλ‹€.
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 20
[2] Standards Mapping - Common Weakness Enumeration Top 25 2021 [4] CWE ID 020
[3] Standards Mapping - Common Weakness Enumeration Top 25 2022 [4] CWE ID 020
[4] Standards Mapping - Common Weakness Enumeration Top 25 2023 [6] CWE ID 020
[5] Standards Mapping - Common Weakness Enumeration Top 25 2024 [12] CWE ID 020
[6] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001082, CCI-002754
[7] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[8] Standards Mapping - NIST Special Publication 800-53 Revision 4 SC-2 Application Partitioning (P1), SI-10 Information Input Validation (P1)
[9] Standards Mapping - NIST Special Publication 800-53 Revision 5 SC-2 Separation of System and User Functionality, SI-10 Information Input Validation
[10] Standards Mapping - OWASP API 2023 API3 Broken Object Property Level Authorization
[11] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.1.3 Input Validation Requirements (L1 L2 L3), 5.1.4 Input Validation Requirements (L1 L2 L3)
[12] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[13] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[14] Standards Mapping - OWASP Top 10 2007 A4 Insecure Direct Object Reference
[15] Standards Mapping - OWASP Top 10 2010 A4 Insecure Direct Object References
[16] Standards Mapping - OWASP Top 10 2013 A4 Insecure Direct Object References
[17] Standards Mapping - OWASP Top 10 2017 A5 Broken Access Control
[18] Standards Mapping - OWASP Top 10 2021 A03 Injection
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.5.2
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[24] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[25] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[28] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 5.4 - Authentication and Access Control
[29] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 5.4 - Authentication and Access Control
[30] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 5.4 - Authentication and Access Control, Control Objective C.2.3 - Web Software Access Controls
[31] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[47] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Process Validation (WASC-40)
desc.structural.java.struts2_bad_practices_request_map_tampering
Abstract
Struts 2.x Action은 κ³΅κ²©μžκ°€ μž„μ˜ 데이터λ₯Ό μ„Έμ…˜, μ‘μš© ν”„λ‘œκ·Έλž¨ λ˜λŠ” μš”μ²­ μ„œλ²„ μͺ½ κ°œμ²΄μ— λ°”μΈλ”©ν•¨μœΌλ‘œμ¨ μ‘μš© ν”„λ‘œκ·Έλž¨ λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ„ μˆ˜μ •ν•  수 μžˆλ„λ‘ ν•˜λŠ” 클래슀λ₯Ό κ΅¬ν˜„ν•©λ‹ˆλ‹€.
Explanation
Apache Struts 2.xμ—λŠ” κ°œλ°œμžκ°€ Actions μ½”λ“œμ— κ΄€λ ¨ λŸ°νƒ€μž„ 정보가 ν¬ν•¨λœ 맡을 μ‰½κ²Œ μ‚½μž…ν•  수 μžˆλŠ” μƒˆλ‘œμš΄ Aware μΈν„°νŽ˜μ΄μŠ€κ°€ ν¬ν•¨λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€λ‘œλŠ” org.apache.struts2.interceptor.ApplicationtAware, org.apache.struts2.interceptor.SessionAware 및 org.apache.struts2.interceptor.RequestAwareκ°€ μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 데이터 맡을 μžμ‹ μ΄ κ°œλ°œν•œ Actions μ½”λ“œμ— μ‚½μž…ν•˜λ €λŠ” κ°œλ°œμžλŠ” μΈν„°νŽ˜μ΄μŠ€μ— μ§€μ •λœ setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•©λ‹ˆλ‹€(예: SessionAware μΈν„°νŽ˜μ΄μŠ€μ˜ 경우 setSession).

public class VulnerableAction extends ActionSupport implements SessionAware {

protected Map<String, Object> session;

@Override
public void setSession(Map<String, Object> session) {
this.session = session;
}

반면 Struts 2.xλŠ” Action에 μ •μ˜λœ 곡용 μ ‘κ·Όμžλ₯Ό 톡해 μ‚¬μš©μžλ‘œλΆ€ν„° μ œκ³΅λ˜λŠ” μš”μ²­ 데이터λ₯Ό Action의 속성에 μžλ™μœΌλ‘œ λ°”μΈλ”©ν•©λ‹ˆλ‹€. Aware μΈν„°νŽ˜μ΄μŠ€λ₯Ό μ‚¬μš©ν•˜λ €λ©΄ Aware μΈν„°νŽ˜μ΄μŠ€μ— μ •μ˜λœ 곡용 setterλ₯Ό κ΅¬ν˜„ν•΄μ•Ό ν•˜λ©°, 이 setter 도 Aware μΈν„°νŽ˜μ΄μŠ€ setter 이름과 μΌμΉ˜ν•˜λŠ” λͺ¨λ“  μš”μ²­ 맀개 λ³€μˆ˜μ— μžλ™μœΌλ‘œ λ°”μΈλ”©λ©λ‹ˆλ‹€. 이 λ™μž‘μœΌλ‘œ 인해 SessionAware, RequestAware, ApplicationAware μΈν„°νŽ˜μ΄μŠ€μ—μ„œ 보여 μ€€ κ²ƒμ²˜λŸΌ 원격 κ³΅κ²©μžκ°€ 영ν–₯을 λ°›λŠ” μΈν„°νŽ˜μ΄μŠ€λ₯Ό κ΅¬ν˜„ν•œ μ‘μš© ν”„λ‘œκ·Έλž¨μ— μ‘°μž‘λœ 맀개 λ³€μˆ˜λ₯Ό μ œκ³΅ν•˜μ—¬ λŸ°νƒ€μž„ 데이터 값을 μˆ˜μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ URL을 톡해 κ³΅κ²©μžκ°€ μ„Έμ…˜ λ§΅μ—μ„œ "roles" 속성을 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 κ³΅κ²©μžκ°€ κ΄€λ¦¬μžκ°€ 될 μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

http://server/VulnerableAction?session.roles=admin


μ΄λŸ¬ν•œ μΈν„°νŽ˜μ΄μŠ€μ—μ„œλŠ” setter μ ‘κ·Όμž κ΅¬ν˜„λ§Œ μš”κ΅¬ν•˜μ§€λ§Œ ν•΄λ‹Ήν•˜λŠ” getter 도 κ΅¬ν˜„ν•œ 경우 μ΄λŸ¬ν•œ 맡 μ»¬λ ‰μ…˜ λ³€κ²½ 사항은 ν˜„μž¬ μš”μ²­ λ²”μœ„μ—λ§Œ μ μš©λ˜λŠ” 것이 μ•„λ‹ˆλΌ μ„Έμ…˜ λ²”μœ„ λ‚΄μ—μ„œ μ§€μ†λ©λ‹ˆλ‹€.
References
[1] Standards Mapping - Common Weakness Enumeration CWE ID 20
[2] Standards Mapping - Common Weakness Enumeration Top 25 2021 [4] CWE ID 020
[3] Standards Mapping - Common Weakness Enumeration Top 25 2022 [4] CWE ID 020
[4] Standards Mapping - Common Weakness Enumeration Top 25 2023 [6] CWE ID 020
[5] Standards Mapping - Common Weakness Enumeration Top 25 2024 [12] CWE ID 020
[6] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-001082, CCI-002754
[7] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[8] Standards Mapping - NIST Special Publication 800-53 Revision 4 SC-2 Application Partitioning (P1), SI-10 Information Input Validation (P1)
[9] Standards Mapping - NIST Special Publication 800-53 Revision 5 SC-2 Separation of System and User Functionality, SI-10 Information Input Validation
[10] Standards Mapping - OWASP API 2023 API3 Broken Object Property Level Authorization
[11] Standards Mapping - OWASP Application Security Verification Standard 4.0 5.1.3 Input Validation Requirements (L1 L2 L3), 5.1.4 Input Validation Requirements (L1 L2 L3)
[12] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[13] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[14] Standards Mapping - OWASP Top 10 2007 A4 Insecure Direct Object Reference
[15] Standards Mapping - OWASP Top 10 2010 A4 Insecure Direct Object References
[16] Standards Mapping - OWASP Top 10 2013 A4 Insecure Direct Object References
[17] Standards Mapping - OWASP Top 10 2017 A5 Broken Access Control
[18] Standards Mapping - OWASP Top 10 2021 A03 Injection
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.6
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.5.2
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 2.0 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[24] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[25] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[26] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[27] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[28] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[29] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection
[30] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection
[31] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002150 CAT II, APSC-DV-002560 CAT I
[47] Standards Mapping - Web Application Security Consortium Version 2.00 Insufficient Process Validation (WASC-40)
desc.structural.java.struts2_bad_practices_session_map_tampering
Abstract
Action Fieldκ°€ ν•΄λ‹Ή 검증 μ •μ˜ 없이 λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
Explanation
ν•˜λ‚˜ μ΄μƒμ˜ Action Fieldμ—λŠ” ν•΄λ‹Ή 검증 μ •μ˜κ°€ μ—†μŠ΅λ‹ˆλ‹€. 각 ν•„λ“œμ—λŠ” ActionClass-validation.xmlμ—μ„œ μ°Έμ‘°ν•œ λͺ…μ‹œμ μΈ 검증 루틴이 μžˆμ–΄μ•Ό ν•©λ‹ˆλ‹€.

κ°œλ°œμžκ°€ Action Form(μž‘μ—… 폼) 맀핑을 μ‚­μ œν•˜κ±°λ‚˜ 이름을 λ°”κΏ€ λ•Œ 검증 λ‘œμ§μ„ μ—…λ°μ΄νŠΈν•˜λŠ” 것을 잊기 μ‰½μŠ΅λ‹ˆλ‹€. 검증 둜직이 μ˜¬λ°”λ‘œ μœ μ§€ κ΄€λ¦¬λ˜κ³  μžˆμ§€ μ•ŠμŒμ„ μž…μ¦ν•˜λŠ” ν•œ 가지 사둀가 λ°”λ‘œ 검증 μ •μ˜μ˜ λΆ€μ‘±μž…λ‹ˆλ‹€.

검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„κ³Ό λ™κΈ°ν™”ν•˜λŠ” 것은 맀우 μ€‘μš”ν•©λ‹ˆλ‹€. κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯은 μ˜€λŠ˜λ‚  κ°€μž₯ λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  κ°€μž₯ μ‹¬κ°ν•œ μ†Œν”„νŠΈμ›¨μ–΄ λ³΄μ•ˆ 문제의 μ›μΈμž…λ‹ˆλ‹€. Cross-site scripting, SQL injection 및 process control 취약점은 λͺ¨λ‘ μž…λ ₯κ°’ 검증이 λΆˆμ™„μ „ν•˜κ±°λ‚˜ μ—†λŠ” κ²ƒμ—μ„œ λΉ„λ‘―λ©λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ buffer overflow 곡격을 κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 108
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 SI
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.1
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[25] 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
[26] 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
[27] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[47] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[48] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[50] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.structural.java.struts2_action_field_without_validator
Abstract
λ™μΌν•œ μ΄λ¦„μ˜ Struts2 ν•„λ“œ μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ μ—¬λŸ¬ 개 μ‘΄μž¬ν•©λ‹ˆλ‹€. μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ μ€‘λ³΅λ˜λ©΄ 검증이 μ΅œμ‹  μƒνƒœκ°€ μ•„λ‹˜μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
Explanation
λ™μΌν•œ μ΄λ¦„μ˜ ν•„λ“œ μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ ActionClass-validation.xml에 λ‘˜ 이상 μžˆμŠ΅λ‹ˆλ‹€. 이름이 같은 검증 μ •μ˜κ°€ μ€‘λ³΅λ˜μ–΄ 있으면 예기치 μ•Šμ€ λ™μž‘μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

예제 1: λ‹€μŒ ν•­λͺ©μ€ μ€‘λ³΅λœ ν•„λ“œ μœ νš¨μ„± 검사기 μ •μ˜ 2개λ₯Ό λ³΄μ—¬μ€λ‹ˆλ‹€.


<field name="emailField">
<field-validator type="email" short-circuit="true">
<message>You must enter a value for email.</message>
</field-validator>
<field-validator type="email" short-circuit="true">
<message>Not a valid email.</message>
</field-validator>
</field>


검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„κ³Ό λ™κΈ°ν™”ν•˜λŠ” 것은 맀우 μ€‘μš”ν•©λ‹ˆλ‹€. κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯은 μ˜€λŠ˜λ‚  κ°€μž₯ λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  κ°€μž₯ μ‹¬κ°ν•œ μ†Œν”„νŠΈμ›¨μ–΄ λ³΄μ•ˆ 문제의 μ›μΈμž…λ‹ˆλ‹€. Cross-Site Scripting, SQL Injection 및 Process Control 취약점은 λͺ¨λ‘ μž…λ ₯κ°’ 검증이 λΆˆμ™„μ „ν•˜κ±°λ‚˜ μ—†λŠ” κ²ƒμ—μ„œ λΉ„λ‘―λ©λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ 버퍼 μ˜€λ²„ν”Œλ‘œ 곡격을 μ‹œμž‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 102
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 CM
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.10
[17] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[18] 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
[19] 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
[20] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[21] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[22] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[23] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[24] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[25] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[26] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[27] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.config.java.struts2_duplicate_action_field_validators
Abstract
Multiple Struts2 Validation νŒŒμΌμ€ 이 μž‘μ—…μ„ μœ„ν•œ κ²ƒμž…λ‹ˆλ‹€. Validation Form(검증 폼)이 μ—¬λŸΏ μžˆλ‹€λŠ” 것은 검증이 μ΅œμ‹ μ΄ μ•„λ‹˜μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
Explanation
λ‘˜ μ΄μƒμ˜ ActionClass-validation.xml 파일이 이 Struts2 Action μ •μ˜μ— λŒ€ν•΄ λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€. ActionClass의 폼으둜 μ •μ˜λœ 각 Struts2 Action에 λŒ€ν•΄ Struts2λŠ” ν•„μš”ν•œ 검증 μ œμ•½ 쑰건의 ν•΄λ‹Ή ActionClass-validation.xml을 κ²€μƒ‰ν•©λ‹ˆλ‹€. 배포에 ν•˜λ‚˜μ˜ μž‘μ—…μ— λŒ€ν•΄ 검증 μ •μ˜κ°€ μ—¬λŸΏ 있으면 예기치 λͺ»ν•œ λ™μž‘μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

이름이 같은 Validation Form(검증 폼)이 두 개 μžˆλŠ” 경우 Struts μœ νš¨μ„± κ²€μ‚¬κΈ°λŠ” μž„μ˜λ‘œ 폼 쀑 ν•˜λ‚˜λ₯Ό μ„ νƒν•˜μ—¬ μž…λ ₯κ°’ 검증에 μ‚¬μš©ν•˜κ³  λ‚˜λ¨Έμ§€λŠ” μ‚­μ œν•©λ‹ˆλ‹€. 이 결정은 ν”„λ‘œκ·Έλž˜λ¨Έμ˜ μ˜ˆμƒκ³Ό μΌμΉ˜ν•˜μ§€ μ•Šμ„ 수 μžˆμŠ΅λ‹ˆλ‹€. 뿐만 μ•„λ‹ˆλΌ, 검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μžˆμ§€ μ•Šλ‹€λŠ” 것을 μ˜λ―Έν•˜κ³  λ‹€λ₯Έ 더 λ³΅μž‘ν•œ 검증 였λ₯˜κ°€ μ‘΄μž¬ν•œλ‹€λŠ” 것을 μ˜λ―Έν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„κ³Ό λ™κΈ°ν™”ν•˜λŠ” 것은 맀우 μ€‘μš”ν•©λ‹ˆλ‹€. κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯은 μ˜€λŠ˜λ‚  κ°€μž₯ λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  κ°€μž₯ μ‹¬κ°ν•œ μ†Œν”„νŠΈμ›¨μ–΄ λ³΄μ•ˆ 문제의 μ›μΈμž…λ‹ˆλ‹€. Cross-site scripting, SQL injection 및 process control 취약점은 λͺ¨λ‘ μž…λ ₯κ°’ 검증이 λΆˆμ™„μ „ν•˜κ±°λ‚˜ μ—†λŠ” κ²ƒμ—μ„œ λΉ„λ‘―λ©λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ buffer overflow 곡격을 κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 102
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 CM
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.10
[17] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[18] 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
[19] 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
[20] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[21] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[22] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[23] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[24] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[25] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[26] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[27] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.structural.java.struts2_duplicate_validation_files
Abstract
λ™μΌν•œ μ΄λ¦„μ˜ Struts2 μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ μ—¬λŸ¬ 개 μ‘΄μž¬ν•©λ‹ˆλ‹€. μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ μ€‘λ³΅λ˜λ©΄ 검증이 μ΅œμ‹  μƒνƒœκ°€ μ•„λ‹˜μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
Explanation
validators.xmlμ—μ„œ λ‘˜ μ΄μƒμ˜ μœ νš¨μ„± 검사기 μ •μ˜κ°€ λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이름이 같은 검증 μ •μ˜κ°€ μ—¬λŸ¬ 개 있으면 예기치 μ•Šμ€ λ™μž‘μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

2개의 검증 ν΄λž˜μŠ€κ°€ λ™μΌν•œ μ΄λ¦„μœΌλ‘œ μ •μ˜λœ 경우 Struts μœ νš¨μ„± κ²€μ‚¬κΈ°λŠ” μž…λ ₯ 검증에 μ‚¬μš©ν•  ν˜•μ‹ 쀑 ν•˜λ‚˜λ₯Ό μž„μ˜λ‘œ μ„ νƒν•˜κ³  λ‹€λ₯Έ ν•˜λ‚˜λŠ” μ‚­μ œν•©λ‹ˆλ‹€. 이 결정은 ν”„λ‘œκ·Έλž˜λ¨Έμ˜ μ˜ˆμƒκ³Ό μΌμΉ˜ν•˜μ§€ μ•Šμ„ 수 μžˆμŠ΅λ‹ˆλ‹€. 그뿐만 μ•„λ‹ˆλΌ, 검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μžˆμ§€ μ•Šλ‹€λŠ” 것을 μ˜λ―Έν•˜κ³  λ‹€λ₯Έ 더 λ³΅μž‘ν•œ 검증 였λ₯˜κ°€ μ‘΄μž¬ν•œλ‹€λŠ” 것을 μ˜λ―Έν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„κ³Ό λ™κΈ°ν™”ν•˜λŠ” 것은 맀우 μ€‘μš”ν•©λ‹ˆλ‹€. κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯은 μ˜€λŠ˜λ‚  κ°€μž₯ λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  κ°€μž₯ μ‹¬κ°ν•œ μ†Œν”„νŠΈμ›¨μ–΄ λ³΄μ•ˆ 문제의 μ›μΈμž…λ‹ˆλ‹€. Cross-Site Scripting, SQL Injection 및 Process Control 취약점은 λͺ¨λ‘ μž…λ ₯κ°’ 검증이 λΆˆμ™„μ „ν•˜κ±°λ‚˜ μ—†λŠ” κ²ƒμ—μ„œ λΉ„λ‘―λ©λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ 버퍼 μ˜€λ²„ν”Œλ‘œ 곡격을 μ‹œμž‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 102
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 CM
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.10
[17] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[18] 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
[19] 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
[20] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[21] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[22] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[23] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[24] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[25] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[26] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[27] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.config.java.struts2_duplicate_validators
Abstract
ActionClass-validation.xmlμ—μ„œ 참쑰된 μœ νš¨μ„± 검사기가 validators.xmlμ—μ„œ μ„ μ–Έλ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.
Explanation
Struts2λŠ” Action μœ νš¨μ„± 검사기 μ •μ˜μ—μ„œ μ‚¬μš©μž 지정 μœ νš¨μ„± 검사기λ₯Ό μ‚¬μš©ν•˜κΈ° 전에 validators.xmlμ—μ„œ μ •μ˜ν•  것을 μš”κ΅¬ν•©λ‹ˆλ‹€. μœ νš¨μ„± 검사기 μ°Έμ‘°κ°€ λˆ„λ½λ˜μ–΄ 있으면 검증이 μ΅œμ‹  μƒνƒœκ°€ μ•„λ‹˜μ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.

예제 1: λ‹€μŒ μž‘μ—… μœ νš¨μ„± κ²€μ‚¬κΈ°λŠ” validators.xmlμ—μ„œ μ •μ˜λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.

<validators>
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
</validators>


검증 λ‘œμ§μ„ μœ μ§€ κ΄€λ¦¬ν•˜κ³  μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„κ³Ό λ™κΈ°ν™”ν•˜λŠ” 것은 맀우 μ€‘μš”ν•©λ‹ˆλ‹€. κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯은 μ˜€λŠ˜λ‚  κ°€μž₯ λΉˆλ²ˆν•˜κ²Œ λ°œμƒν•˜κ³  κ°€μž₯ μ‹¬κ°ν•œ μ†Œν”„νŠΈμ›¨μ–΄ λ³΄μ•ˆ 문제의 μ›μΈμž…λ‹ˆλ‹€. Cross-Site Scripting, SQL Injection 및 Process Control 취약점은 λͺ¨λ‘ μž…λ ₯κ°’ 검증이 λΆˆμ™„μ „ν•˜κ±°λ‚˜ μ—†λŠ” κ²ƒμ—μ„œ λΉ„λ‘―λ©λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ 버퍼 μ˜€λ²„ν”Œλ‘œ 곡격을 μ‹œμž‘ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 1173
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 SI
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.1
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[25] 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
[26] 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
[27] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[47] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[48] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[50] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.config.java.struts2_undeclared_validator
Abstract
Struts2 ActionsλŠ” Struts Validation ν”„λ ˆμž„μ›Œν¬λ₯Ό ν™œμš©ν•˜μ—¬ κ²€μ¦λ˜μ§€ μ•Šμ€ μž…λ ₯으둜 μΈν•œ 취약점을 λ°©μ§€ν•©λ‹ˆλ‹€.
Explanation
ν™•μΈλ˜μ§€ μ•Šμ€ μž…λ ₯은 J2EE μ‘μš© ν”„λ‘œκ·Έλž¨ μ·¨μ•½μ μ˜ 주된 μ›μΈμž…λ‹ˆλ‹€. ν™•μΈλ˜μ§€ μ•Šμ€ μž…λ ₯은 Cross-Site Scripting, Process Control 및 SQL Injection λ“± μˆ˜λ§Žμ€ 취약점을 μ•ΌκΈ°ν•  수 μžˆμŠ΅λ‹ˆλ‹€. J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ€ 보톡 λ©”λͺ¨λ¦¬ 손상 κ³΅κ²©μ—λŠ” μ·¨μ•½ν•˜μ§€ μ•Šμ§€λ§Œ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ λ°°μ—΄ λ²”μœ„ 검사λ₯Ό μˆ˜ν–‰ν•˜μ§€ μ•ŠλŠ” λ„€μ΄ν‹°λΈŒ μ½”λ“œμ™€ μƒν˜Έ μž‘μš©ν•˜λŠ” 경우, κ³΅κ²©μžκ°€ J2EE μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μž…λ ₯κ°’ 검증 μ‹€μˆ˜λ₯Ό μ΄μš©ν•˜μ—¬ Buffer Overflow 곡격을 κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

이런 곡격을 막기 μœ„ν•΄ Struts Validation ν”„λ ˆμž„μ›Œν¬λ₯Ό μ‚¬μš©ν•˜μ—¬ μ‘μš© ν”„λ‘œκ·Έλž¨μ΄ μ²˜λ¦¬ν•˜κΈ° 전에 λͺ¨λ“  ν”„λ‘œκ·Έλž¨ μž…λ ₯을 κ²€μ‚¬ν•©λ‹ˆλ‹€. Fortify Static Code Analyzerλ₯Ό μ‚¬μš©ν•˜μ—¬ Struts μœ νš¨μ„± 검사기 ꡬ성에 μ•„λ¬΄λŸ° ν—ˆμ μ΄ μ—†λŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€.

μœ νš¨μ„± 검사기 μ‚¬μš© μ˜ˆμ œμ—λŠ” λ‹€μŒκ³Ό 같은 검사가 ν¬ν•¨λ©λ‹ˆλ‹€.

- μ „ν™” 번호 ν•„λ“œμ—λŠ” μ „ν™” λ²ˆν˜Έλ‘œμ„œ μœ νš¨ν•œ 문자만 μ‚¬μš©ν•©λ‹ˆλ‹€.

- λΆ€μšΈ 값은 "T"와 "F"λΏμž…λ‹ˆλ‹€.

- 자유 ν˜•μ‹ λ¬Έμžμ—΄μ€ μ μ ˆν•œ 길이와 ꡬ성을 μœ μ§€ν•©λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts Project The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 1173
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 SI
[6] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[7] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[8] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[9] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[10] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[11] Standards Mapping - OWASP Top 10 2004 A1 Unvalidated Input
[12] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[15] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.1
[17] Standards Mapping - Payment Card Industry Data Security Standard Version 1.2 Requirement 6.3.1.1
[18] Standards Mapping - Payment Card Industry Data Security Standard Version 3.0 Requirement 6.5.1
[19] Standards Mapping - Payment Card Industry Data Security Standard Version 3.1 Requirement 6.5.1
[20] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2 Requirement 6.5.1
[21] Standards Mapping - Payment Card Industry Data Security Standard Version 3.2.1 Requirement 6.5.1
[22] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[23] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[24] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[25] 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
[26] 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
[27] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[44] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[45] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[46] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[47] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[48] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[49] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[50] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.structural.java.struts2_unvalidated_action
Abstract
ν•΄λ‹Ήν•˜λŠ” Struts2 Action이 μ—†λŠ” Struts2 검증 파일이 μžˆμŠ΅λ‹ˆλ‹€.
Explanation
μΌμΉ˜ν•˜λŠ” Struts2 Action이 μ—†λŠ” Struts2 검증 파일이 λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 각 ActionClass에 λŒ€ν•΄ Struts2λŠ” ν•„μš”ν•œ 검증 μ œμ•½ 쑰건에 ν•΄λ‹Ήν•˜λŠ” ActionClass-validation.xml을 κ²€μƒ‰ν•©λ‹ˆλ‹€. 이 경우, ActionClass-validation.xml ν˜•νƒœμ˜ 검증 νŒŒμΌμ„ μ°Ύμ•˜μ§€λ§Œ ActionClassκ°€ Struts2 ꡬ성 νŒŒμΌμ— μ •μ˜λœ Actionκ³Ό μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

κ°œλ°œμžκ°€ Action Form(μž‘μ—… 폼) 맀핑을 μ œκ±°ν•˜κ±°λ‚˜ 이름을 λ°”κΏ€ λ•Œ 검증 λ‘œμ§μ„ μ—…λ°μ΄νŠΈν•˜λŠ” 것을 잊기 μ‰½μŠ΅λ‹ˆλ‹€. 검증 둜직이 μ˜¬λ°”λ‘œ μœ μ§€ κ΄€λ¦¬λ˜κ³  μžˆμ§€ μ•ŠμŒμ„ μž…μ¦ν•˜λŠ” ν•œ 가지 사둀가 λ°”λ‘œ Unused validation form의 μ‘΄μž¬μž…λ‹ˆλ‹€.
References
[1] The Struts2 Validation Framework The Apache Foundation
[2] Standards Mapping - Common Weakness Enumeration CWE ID 1173
[3] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[4] Standards Mapping - FIPS200 CM
[5] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[6] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[7] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[8] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[9] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[10] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[11] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[12] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[14] Standards Mapping - Payment Card Industry Data Security Standard Version 1.1 Requirement 6.5.10
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[16] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
[17] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[18] 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
[19] 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
[20] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[21] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[22] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[23] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[24] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[25] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[26] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[27] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.config.java.struts2_validation_file_without_action
Abstract
Struts2 μœ νš¨μ„± 검사기가 μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” μž‘μ—… ν•„λ“œμ— λŒ€ν•΄ μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
Explanation
Struts2 μœ νš¨μ„± 검사기 μ •μ˜κ°€ μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” μž‘μ—… ν•„λ“œλ₯Ό μ°Έμ‘°ν•©λ‹ˆλ‹€.

κ°œλ°œμžκ°€ Action Form(μž‘μ—… 폼) 맀핑을 μ œκ±°ν•˜κ±°λ‚˜ 이름을 λ°”κΏ€ λ•Œ 검증 λ‘œμ§μ„ μ—…λ°μ΄νŠΈν•˜λŠ” 것을 잊기 μ‰½μŠ΅λ‹ˆλ‹€. 검증 논리가 μ μ ˆν•˜κ²Œ μœ μ§€ κ΄€λ¦¬λ˜μ§€ μ•Šκ³  μžˆλ‹€λŠ” ν•œ 가지 μ§•ν›„λŠ” λΆ„λ¦¬λœ Validator μ •μ˜κ°€ μžˆλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€.
References
[1] T. Husted et al. Struts in Action: Building Web Applications with the Leading Java Framework Manning Publications
[2] The Struts2 Validation Framework The Apache Foundation
[3] Standards Mapping - Common Weakness Enumeration CWE ID 105
[4] Standards Mapping - DISA Control Correlation Identifier Version 2 CCI-002754
[5] Standards Mapping - FIPS200 CM
[6] Standards Mapping - NIST Special Publication 800-53 Revision 4 SI-10 Information Input Validation (P1)
[7] Standards Mapping - NIST Special Publication 800-53 Revision 5 SI-10 Information Input Validation
[8] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[9] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[10] Standards Mapping - OWASP Top 10 2004 A10 Insecure Configuration Management
[11] Standards Mapping - OWASP Top 10 2010 A6 Security Misconfiguration
[12] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[13] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[14] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[15] Standards Mapping - Payment Card Industry Data Security Standard Version 1.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, Control Objective B.3.1 - Terminal Software Attack Mitigation, Control Objective B.3.1.1 - Terminal Software Attack Mitigation
[20] 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
[21] Standards Mapping - Security Technical Implementation Guide Version 3.1 APP3510 CAT I
[22] Standards Mapping - Security Technical Implementation Guide Version 3.4 APP3510 CAT I
[23] Standards Mapping - Security Technical Implementation Guide Version 3.5 APP3510 CAT I
[24] Standards Mapping - Security Technical Implementation Guide Version 3.6 APP3510 CAT I
[25] Standards Mapping - Security Technical Implementation Guide Version 3.7 APP3510 CAT I
[26] Standards Mapping - Security Technical Implementation Guide Version 3.9 APP3510 CAT I
[27] Standards Mapping - Security Technical Implementation Guide Version 3.10 APP3510 CAT I
[28] Standards Mapping - Security Technical Implementation Guide Version 4.2 APSC-DV-002560 CAT I
[29] Standards Mapping - Security Technical Implementation Guide Version 4.3 APSC-DV-002560 CAT I
[30] Standards Mapping - Security Technical Implementation Guide Version 4.4 APSC-DV-002560 CAT I
[31] Standards Mapping - Security Technical Implementation Guide Version 4.5 APSC-DV-002560 CAT I
[32] Standards Mapping - Security Technical Implementation Guide Version 4.6 APSC-DV-002560 CAT I
[33] Standards Mapping - Security Technical Implementation Guide Version 4.7 APSC-DV-002560 CAT I
[34] Standards Mapping - Security Technical Implementation Guide Version 4.8 APSC-DV-002560 CAT I
[35] Standards Mapping - Security Technical Implementation Guide Version 4.9 APSC-DV-002560 CAT I
[36] Standards Mapping - Security Technical Implementation Guide Version 4.10 APSC-DV-002560 CAT I
[37] Standards Mapping - Security Technical Implementation Guide Version 4.11 APSC-DV-002560 CAT I
[38] Standards Mapping - Security Technical Implementation Guide Version 4.1 APSC-DV-002560 CAT I
[39] Standards Mapping - Security Technical Implementation Guide Version 5.1 APSC-DV-002560 CAT I
[40] Standards Mapping - Security Technical Implementation Guide Version 5.2 APSC-DV-002560 CAT I
[41] Standards Mapping - Security Technical Implementation Guide Version 5.3 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[42] Standards Mapping - Security Technical Implementation Guide Version 6.1 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[43] Standards Mapping - Security Technical Implementation Guide Version 6.2 APSC-DV-002530 CAT II, APSC-DV-002560 CAT I
[44] Standards Mapping - Web Application Security Consortium Version 2.00 Application Misconfiguration (WASC-15)
desc.config.java.struts2_validator_without_action_field
Abstract
이름이 같은 form-bean ν•­λͺ©μ΄ μ—¬λŸ¬ 개 μžˆμŠ΅λ‹ˆλ‹€. μ€‘λ³΅λœ form-bean 이름은 μ’…μ’… 디버그 μ½”λ“œ λ˜λŠ” μž…λ ₯ 였λ₯˜κ°€ 남아 μžˆμŒμ„ λ‚˜νƒ€λƒ…λ‹ˆλ‹€.
Explanation
μ—¬λŸ¬ form-bean νƒœκ·Έμ— λ™μΌν•œ 이름이 μ‚¬μš©λ˜λŠ” 경우 λ§ˆμ§€λ§‰ ν•­λͺ©λ§Œ λ“±λ‘λ˜λ―€λ‘œ μ€‘λ³΅λœ <form-bean> 이름은 μ•„λ¬΄λŸ° μ†Œμš©μ΄ μ—†μŠ΅λ‹ˆλ‹€.

예제 1: λ‹€μŒ κ΅¬μ„±μ—λŠ” 이름이 같은 2개의 form-bean ν•­λͺ©μ΄ μžˆμŠ΅λ‹ˆλ‹€.

<form-beans>
<form-bean name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="name" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
</form-bean>
<form-bean name="loginForm" type="org.apache.struts.validator.DynaActionForm">
<form-property name="favoriteColor" type="java.lang.String" />
</form-bean>
</form-beans>
References
[1] Apache Struts 1.3 Specification
[2] Standards Mapping - Common Weakness Enumeration CWE ID 694
[3] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[4] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[5] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[6] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[7] Standards Mapping - Payment Card Industry Software Security Framework 1.0 Control Objective 4.2 - Critical Asset Protection
[8] Standards Mapping - Payment Card Industry Software Security Framework 1.1 Control Objective 4.2 - Critical Asset Protection
[9] Standards Mapping - Payment Card Industry Software Security Framework 1.2 Control Objective 4.2 - Critical Asset Protection
desc.config.java.struts_misconfiguration_duplicate_form_bean
Abstract
경둜 ν•­λͺ©μ΄ μœ νš¨ν•˜μ§€ μ•ŠμœΌλ©΄ Strutsκ°€ μ„œλΉ„μŠ€ μš”μ²­μ— λŒ€ν•œ μ˜¬λ°”λ₯Έ λ¦¬μ†ŒμŠ€λ₯Ό 찾지 λͺ»ν•©λ‹ˆλ‹€.
Explanation
StrutsλŠ” path 속성을 μ‚¬μš©ν•˜μ—¬ μš”μ²­μ„ μ²˜λ¦¬ν•˜λŠ” 데 ν•„μš”ν•œ λ¦¬μ†ŒμŠ€λ₯Ό μ°ΎμŠ΅λ‹ˆλ‹€. κ²½λ‘œλŠ” λͺ¨λ“ˆ μƒλŒ€ μœ„μΉ˜μ΄λ―€λ‘œ "/" 문자둜 μ‹œμž‘λ˜μ§€ μ•ŠλŠ” κ²½λ‘œλŠ” 였λ₯˜μž…λ‹ˆλ‹€.

예제 1: λ‹€μŒ κ΅¬μ„±μ—λŠ” 빈 κ²½λ‘œκ°€ μžˆμŠ΅λ‹ˆλ‹€.

<global-exceptions>
<exception key="global.error.invalidLogin" path="" scope="request" type="InvalidLoginException" />
</global-exceptions>
예제 2: λ‹€μŒ ꡬ성은 "/" 문자둜 μ‹œμž‘λ˜μ§€ μ•ŠλŠ” 경둜λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

<global-forwards>
<forward name="login" path="Login.jsp" />
</global-forwards>
References
[1] Apache Struts Specification
[2] Chuck Caveness, Brian Keeton
[3] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[4] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[5] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[6] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[7] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
desc.config.java.struts_misconfiguration_invalid_path
Abstract
λͺ…λͺ…λœ Struts μž‘μ—…μ— λŒ€ν•œ input 속성을 μƒλž΅ν•˜λŠ” 것은 검증 였λ₯˜λ₯Ό λ°˜ν™˜ν•  수 μžˆλŠ” 였λ₯˜μž…λ‹ˆλ‹€.
Explanation
Struts 사양은 λͺ…λͺ…λœ μž‘μ—…μ—μ„œ 검증 였λ₯˜λ₯Ό λ°˜ν™˜ν•  λ•Œλ§ˆλ‹€ input 속성을 μš”κ΅¬ν•©λ‹ˆλ‹€[2]. input 속성은 검증 였λ₯˜κ°€ λ°œμƒν•  λ•Œ 였λ₯˜ λ©”μ‹œμ§€λ₯Ό ν‘œμ‹œν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” νŽ˜μ΄μ§€λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€.
예제 1: λ‹€μŒ ꡬ성은 λͺ…λͺ…λœ 검증 μž‘μ—…μ„ μ •μ˜ν•˜μ§€λ§Œ input 속성을 μ§€μ •ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

<action-mappings>
<action path="/Login"
type="com.LoginAction"
name="LoginForm"
scope="request"
validate="true" />
</action-mappings>
References
[1] Apache Struts Specification
[2] Standards Mapping - General Data Protection Regulation (GDPR) Indirect Access to Sensitive Data
[3] Standards Mapping - OWASP API 2023 API8 Security Misconfiguration
[4] Standards Mapping - OWASP Mobile 2014 M1 Weak Server Side Controls
[5] Standards Mapping - OWASP Top 10 2013 A5 Security Misconfiguration
[6] Standards Mapping - OWASP Top 10 2017 A6 Security Misconfiguration
[7] Standards Mapping - OWASP Top 10 2021 A05 Security Misconfiguration
[8] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0 Requirement 6.2.4
[9] Standards Mapping - Payment Card Industry Data Security Standard Version 4.0.1 Requirement 6.2.4
desc.config.java.struts_misconfiguration_missing_action_input