Github Advisory Databaseμ—λŠ” Maven에 λŒ€ν•΄ μ•½ 3800개의 취약점 정보가 μžˆλ‹€. νšŒμ‚¬μ—μ„œ μ„œλΉ„μŠ€ λͺ¨λ‹ˆν„°λ§μ„ μœ„ν•œ μ‹œμŠ€ν…œμ΄ κ΅¬μΆ•λ˜μ–΄μžˆμ§€λŠ” μ•Šμ§€λ§Œ μž„μ‹œμ μœΌλ‘œ 뉴렐릭을 μ μš©ν•œ ν™˜κ²½μ΄ μžˆμ–΄ APM & Services의 Vulnerability Management λ©”λ‰΄μ—μ„œ λ³΄μ•ˆ 취약점 정보λ₯Ό 확인할 수 μžˆμ—ˆλ‹€. μš°μ„  체크된 λ³΄μ•ˆ 취약점은 58개둜 CRITICAL 6개, HIGH 25개, MEDIUM 21개, LOW 6개 이닀.

Vulnerability

nameseverityexploitableissueId
Pivotal Spring Framework contains unsafe Java deserialization methodsCRITICALFALSECVE-2016-1000027
Deserialization of Untrusted Data in org.codehaus.jackson:jackson-mapper-aslCRITICALFALSECVE-2019-10202
Template injection in thymeleaf-spring5CRITICALFALSECVE-2021-43466
Remote Code Execution in Spring FrameworkCRITICALFALSECVE-2022-22965
Undertow client not checking server identity presented by server certificate in https connectionsCRITICALFALSECVE-2022-4492
Spring Boot Security Bypass with Wildcard Pattern Matching on Cloud FoundryCRITICALFALSECVE-2023-20873
More
nameseverityexploitableissueId
Pivotal Spring Framework contains unsafe Java deserialization methodsCRITICALFALSECVE-2016-1000027
Deserialization of Untrusted Data in org.codehaus.jackson:jackson-mapper-aslCRITICALFALSECVE-2019-10202
Template injection in thymeleaf-spring5CRITICALFALSECVE-2021-43466
Remote Code Execution in Spring FrameworkCRITICALFALSECVE-2022-22965
Undertow client not checking server identity presented by server certificate in https connectionsCRITICALFALSECVE-2022-4492
Spring Boot Security Bypass with Wildcard Pattern Matching on Cloud FoundryCRITICALFALSECVE-2023-20873
Arbitrary code execution in Apache Commons BeanUtilsHIGHFALSECVE-2014-0114
Insecure Deserialization in Apache Commons BeanutilsHIGHFALSECVE-2019-10086
Improper Restriction of XML External Entity Reference in jackson-mapper-aslHIGHFALSECVE-2019-10172
Deeply nested json in jackson-databindHIGHFALSECVE-2020-36518
Undertow Uncontrolled Resource ConsumptionHIGHFALSECVE-2021-3629
Uncaught Exception in jsoupHIGHFALSECVE-2021-37714
Undertow vulnerable to Denial of Service (DoS) attacksHIGHFALSECVE-2021-3859
jackson-databind possible Denial of Service if using JDK serialization to serialize JsonNodeHIGHFALSECVE-2021-46877
SnakeYaml Constructor Deserialization Remote Code ExecutionHIGHFALSECVE-2022-1471
Undertow vulnerable to Dos via Large AJP requestHIGHFALSECVE-2022-2053
pgjdbc Does Not Check Class Instantiation when providing Plugin ClassesHIGHFALSECVE-2022-21724
Improper handling of case sensitivity in Spring FrameworkHIGHFALSECVE-2022-22968
Denial of service in Spring FrameworkHIGHFALSECVE-2022-22970
Deserialization of Untrusted Data in GsonHIGHFALSECVE-2022-25647
Uncontrolled Resource Consumption in snakeyamlHIGHFALSECVE-2022-25857
Partial Path Traversal in com.amazonaws:aws-java-sdk-s3HIGHFALSECVE-2022-31159
PostgreSQL JDBC Driver SQL Injection in ResultSet.refreshRow() with malicious column namesHIGHFALSECVE-2022-31197
Apache Xalan Java XSLT library integer truncation issue when processing malicious XSLT stylesheetsHIGHFALSECVE-2022-34169
Denial of Service due to parser crashHIGHFALSECVE-2022-40153
Uncontrolled Resource Consumption in Jackson-databindHIGHFALSECVE-2022-42003
Uncontrolled Resource Consumption in FasterXML jackson-databindHIGHFALSECVE-2022-42004
json stack overflow vulnerabilityHIGHFALSECVE-2022-45688
json-smart Uncontrolled Recursion vulnerabiltyHIGHFALSECVE-2023-1370
Spring Framework vulnerable to denial of serviceHIGHFALSECVE-2023-20863
Spring Boot Welcome Page Denial of ServiceHIGHFALSECVE-2023-20883
Uncontrolled Resource Consumption in XNIOMEDIUMFALSECVE-2020-14340
Improper privilege management in elasticsearchMEDIUMFALSECVE-2020-7019
Log entry injection in Spring FrameworkMEDIUMFALSECVE-2021-22060
Improper Output Neutralization for Logs in Spring FrameworkMEDIUMFALSECVE-2021-22096
Exposure of Sensitive Information to an Unauthorized ActorMEDIUMFALSECVE-2021-22134
API information disclosure flaw in ElasticsearchMEDIUMFALSECVE-2021-22135
Denial of Service in ElasticsearchMEDIUMFALSECVE-2021-22144
undertow Race Condition vulnerabilityMEDIUMFALSECVE-2021-3597
Allocation of Resources Without Limits or Throttling in Spring FrameworkMEDIUMFALSECVE-2022-22950
Allocation of Resources Without Limits or Throttling in Spring FrameworkMEDIUMFALSECVE-2022-22971
jsoup may not sanitize code injection XSS attempts if SafeList.preserveRelativeLinks is enabledMEDIUMFALSECVE-2022-36033
snakeYAML before 1.31 vulnerable to Denial of Service due to Out-of-bounds WriteMEDIUMFALSECVE-2022-38749
snakeYAML before 1.31 vulnerable to Denial of Service due to Out-of-bounds WriteMEDIUMFALSECVE-2022-38750
snakeYAML before 1.31 vulnerable to Denial of Service due to Out-of-bounds WriteMEDIUMFALSECVE-2022-38751
snakeYAML before 1.32 vulnerable to Denial of Service due to Out-of-bounds WriteMEDIUMFALSECVE-2022-38752
Denial of Service due to parser crashMEDIUMFALSECVE-2022-40152
Snakeyaml vulnerable to Stack overflow leading to denial of serviceMEDIUMFALSECVE-2022-41854
TemporaryFolder on unix-like systems does not limit access to created filesMEDIUMFALSECVE-2022-41946
Spring Framework vulnerable to denial of service via specially crafted SpEL expressionMEDIUMFALSECVE-2023-20861
Guava vulnerable to insecure use of temporary directoryMEDIUMFALSECVE-2023-2976
pgjdbc Arbitrary File Write VulnerabilityMEDIUMFALSEGHSA-673j-qm5f-xpv8
Privilege Context Switching Error in ElasticsearchLOWFALSECVE-2020-7020
Information Disclosure in GuavaLOWFALSECVE-2020-8908
Path traversal in org.postgresql:postgresqlLOWFALSECVE-2022-26520
Denial of Service via stack overflowLOWFALSECVE-2022-40154
Denial of Service via stack overflowLOWFALSECVE-2022-40155
Denial of Service due to parser crashLOWFALSECVE-2022-40156

CRITICAL Vulnerability

μœ„ CRITICAL 레벨의 λ³΄μ•ˆ 취약점 μ€‘μ—μ„œ CVE-2019-10202λ₯Ό μ œμ™Έν•˜κ³ λŠ” 취약점 λŒ€μƒμ΄ λ˜λŠ” μ‹œμŠ€ν…œ ν™˜κ²½μ€ μ•„λ‹ˆκΈ° λ•Œλ¬Έμ— ꡳ이 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ‚¬μš©μ€‘μΈ 라이브러리 μ˜μ‘΄μ„± 버전을 λ³€κ²½ν•  ν•„μš”λŠ” μ—†λ‹€κ³  μƒκ°λœλ‹€. CVE-2019-10202에 λŒ€ν•΄μ„œλŠ” μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ org.codehaus.jackson:jackson-mapper-asl 라이브러리λ₯Ό μ‚¬μš©ν•  ν•„μš”κ°€ μ—†μŒμ—λ„ 일뢀 μ½”λ“œκ°€ λ ˆκ±°μ‹œ ν”„λ‘œμ νŠΈλ‘œλΆ€ν„° λ³΅μ‚¬λ˜μ—ˆκΈ° λ•Œλ¬Έμ— jackson-databind λΌμ΄λΈŒλŸ¬λ¦¬μ— ν¬ν•¨λœ ISO8601Utilsλ₯Ό μ‚¬μš©ν•˜λ„λ‘ μ½”λ“œλ₯Ό λ³€κ²½ν•˜κ³  λΆˆν•„μš”ν•œ jackson-mapper-asl μ˜μ‘΄μ„±μ„ μ œκ±°ν•˜μ˜€λ‹€.

ext {
    set('quartz.version', '2.3.2') // CVE-2019-13990
    set('thymeleaf.version', '3.0.13.RELEASE') // CVE-2021-43466
    set('spring-framework.version', '5.2.24.RELEASE') // CVE-2022-22965
    set('undertow.version', '2.2.24.Final') // CVE-2022-4492]
}

λ‚˜λ¨Έμ§€ CRITICAL 레벨이 μ•„λ‹Œ 취약점은 ꡳ이 μ‘°μΉ˜ν•  ν•„μš”μ„±μ΄ λ†’μ§€λŠ” μ•Šμ•„λ³΄μ΄λ‚˜ μ΅œλŒ€ν•œ 취약점을 μ œκ±°ν•˜κ³ μž 뢄석 ν›„ Github Advisory Databaseλ₯Ό 톡해 취약점이 쑰치된 λ²„μ „μœΌλ‘œ λ³€κ²½ν•˜μ˜€λ‹€.

Vulnerability

취약점 쑰치 이후에 μ²΄ν¬λ˜μ–΄ λ‚¨μ•„μžˆλŠ” 취약점은 μ•„λž˜μ™€ κ°™λ‹€.

nameseverityexploitableissueId
Pivotal Spring Framework contains unsafe Java deserialization methodsCRITICALFALSECVE-2016-1000027
Spring Boot Security Bypass with Wildcard Pattern Matching on Cloud FoundryCRITICALFALSECVE-2023-20873
SnakeYaml Constructor Deserialization Remote Code ExecutionHIGHFALSECVE-2022-1471
Spring Boot Welcome Page Denial of ServiceHIGHFALSECVE-2023-20883

CRITICAL 레벨의 CVE-2016-1000027와 CVE-2023-20873 도 취약점 λ‚΄μš©μ„ μ‚΄νŽ΄λ³΄λ©΄ 취약점이 λ°œμƒν•  수 μžˆλŠ” μ‹œμŠ€ν…œ ν™˜κ²½μ΄ μ•„λ‹ˆκΈ° λ•Œλ¬Έμ— ꡳ이 μ‘°μΉ˜ν•  ν•„μš”κ°€ μ—†λ‹€. λ”κ΅¬λ‚˜ 취약점 정보λ₯Ό μ œκ±°ν•˜κΈ° μœ„ν•΄μ„œλŠ” μƒλ‹Ήνžˆ 높은 μŠ€ν”„λ§ λΆ€νŠΈ 3+으둜 λ³€κ²½ν•΄μ•Όν•˜κΈ° λ•Œλ¬Έμ— ꡳ이 μ‹œλ„ν•˜μ§€ μ•ŠμœΌλ €κ³  ν•œλ‹€.

CVE-2022-1471에 λŒ€ν•΄μ„œλŠ” μŠ€ν”„λ§ λΆ€νŠΈ 2.5.15 μ—μ„œ Improve compatibility with SnakeYAML 2.0 μ²˜λ¦¬κ°€ λ˜μ—ˆκΈ° λ•Œλ¬Έμ— Snakeyaml 라이브러리의 λ²„μ „λ§Œ 2.0+둜 λ³€κ²½ν•˜λ©΄ λ˜μ§€λ§Œ μŠ€ν”„λ§ λΆ€νŠΈ 2.4+둜 λ³€κ²½ν•˜λŠ” 것도 생각보닀 λ§Žμ€ 섀정듀이 λ³€κ²½λ˜μ–΄μ„œ 쉽지 μ•Šλ‹€. λ§Œμ•½, μŠ€ν”„λ§ λΆ€νŠΈ 2.5.15둜 λ³€κ²½ν•œλ‹€λ©΄ CVE-2023-20883도 ν•¨κ»˜ μ‘°μΉ˜ν•  수 μžˆλ‹€.

μ΄λ ‡κ²Œ 취약점 제거 μ‘°μΉ˜λŠ” μˆ˜ν–‰ν–ˆμœΌλ‚˜ μ‹€μ œλ‘œ λ°˜μ˜ν•˜λŠ” 것은 μ‘°μ‹¬ν•΄μ•Όν•œλ‹€. 라이브러리 버전 λ³€κ²½μœΌλ‘œ μΈν•œ μ‹œμŠ€ν…œ 영ν–₯도λ₯Ό μ œλŒ€λ‘œ μ²΄ν¬ν•œλ‹€λŠ” 것을 보μž₯ν•  순 μ—†κΈ° λ•Œλ¬Έμ— ν•œλ²ˆμ— μˆ˜μ •ν•˜λŠ” 것은 지양해야할 수 μžˆλ‹€. μ•žμ„œ, jackson-databind 라이브러리λ₯Ό 2.11.4 μ—μ„œ μƒμœ„ λ²„μ „μœΌλ‘œ μ—…κ·Έλ ˆμ΄λ“œν•˜λŠ” κ³Όμ •μ—μ„œ μ•„λž˜μ™€ 같은 직렬화 μ΄μŠˆκ°€ λ°œμƒν•˜μ˜€λ‹€.

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.Instant` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.Collections$UnmodifiableMap["build"]->java.util.LinkedHashMap["time"])

이와 같은 이슈λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄μ„œ ObjectMapperλ₯Ό λ§Œλ“€μ–΄μ„œ μ‚¬μš©ν•˜λŠ” λͺ¨λ“  μ½”λ“œμ— JavaTimeModule을 μˆ˜λ™μœΌλ‘œ λ“±λ‘ν•˜λ„λ‘ λ³€κ²½ν•΄μ•Όν•œλ‹€.

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new JavaTimeModule());

μΈν…”λ¦¬μ œμ΄λ₯Ό 톡해 κ²€μƒ‰ν•΄λ³΄λ‹ˆ 생각보닀 κ±΄λ“œλ €μ•Όν•˜λŠ” μ½”λ“œκ°€ λ§Žμ•„μ„œ jackson-databind 라이브러리λ₯Ό μƒμœ„ λ²„μ „μœΌλ‘œ λ³€κ²½ν•˜μ§€ μ•Šκ³  2.11.4λ₯Ό μœ μ§€ν•˜κ³ μž ν•œλ‹€.

OWASP Dependency-Check

OWASP Dependency-CheckλΌλŠ” SCA 도ꡬλ₯Ό μ‚¬μš©ν•΄μ„œ CPE와 CVEλ₯Ό κ²€μΆœν•  수 μžˆλ‹€. μ•„λž˜μ™€ 같이 dependencycheck κ·Έλž˜λ“€ ν”ŒλŸ¬κ·ΈμΈμ„ λ“±λ‘ν•˜κ³ λ‚˜μ„œ dependencyCheckAnalyze νƒœμŠ€ν¬λ₯Ό μˆ˜ν–‰ν•˜λ©΄ build/reports/dependency-check-report.html 파일이 μƒμ„±λ˜μ–΄ 취약점 정보λ₯Ό 확인할 수 μžˆλ‹€.

build.gradle
plugins { id 'org.owasp.dependencycheck' version '8.4.0' } dependencyCheck { // build/reports/dependency-check-report.html analyzers { nodeEnabled = false nodeAudit { enabled = false yarnEnabled = false pnpmEnabled = false } } }

μ  ν‚¨μŠ€ OWASP Dependency-Check ν”ŒλŸ¬κ·ΈμΈλ„ μžˆλŠ”λ° OWASP Dependency-Check둜 μ²΄ν¬ν•˜λŠ” 경우 생각보닀 λ§Žμ€ 취약점이 ν™•μΈλ˜μ–΄μ„œ μ΅œμ‹  라이브러리λ₯Ό μ‚¬μš©ν•˜λŠ” ν”„λ‘œμ νŠΈκ°€ μ•„λ‹ˆλΌλ©΄ μ’‹μ•„λ³΄μ΄μ§€λŠ” μ•ŠλŠ”λ‹€. 개인적으둜 CVE κ²€μΆœμ„ μœ„ν•΄μ„œ μ‚¬μš©ν•˜μ§„ μ•Šμ„ 것 κ°™λ‹€.