본문 바로가기

Engineer/Security Vulnerability

GitLab 심각한 보안 취약점 업데이트 권고 (2023-01-20) CVE-2022-41903 / CVE-2022-23521

반응형

GitLab Critical Security Vulnerability (2023-01-20) update to 15.7.5, 15.6.6, 15.5.9 from CVE-2022-41903 / CVE-2022-23521

 

 

 

023년 1월 18일 KISA 홈페이지에 올라온 공지입니다. Git 관련 취약점이 보고되어 (CVE-2022-41903 / CVE-2022-23521) 그에 따른 해결책으로 최신 버전으로의 업데이트를 권고하는 내용입니다. 권고하는 버전은 다음과 같은데요, 사실상 최신 버전이 아닌 경우 모두 업데이트를 해야 하는 상황이라고 생각하시면 됩니다.

 

업데이트 권고 버전

  • 15.7.5
  • 15.6.6
  • 15.5.9

 

 

KISA 홈페이지의 공지에도 링크를 제공하고 있는데요, GitLab의 홈페이지를 방문해 보면 최상단 공지로 신규 버전의 Release 소식과 함께 해당 버전은 보안 취약점을 해결한 버전이기 때문에 꼭 업데이트를 하라는 권고 내용이 포함되어 있습니다. 

 

 

조금 전에도 이야기 했지만 사실상 거의 모든 버전이 영향을 받고 있습니다. 그냥 업데이트 한다고 생각하시고 업데이트를 진행하시면 속 편할 것 같습니다.

 

 

그나저나 대체 뭔 취약점이길래 이 난리인가 궁금하지 않을 수 없는데요, 이번 보안 취약점은 총 2가지라고 합니다.

 

CVE-2022-41903
The git-log command has the ability to display commits using an arbitrary format with its --format specifiers. This functionality is also exposed to git-archive via the export-subst gitattribute.

When processing the padding operators (e.g., %<(, %<|(, %>(, %>>(, or %><( ), an integer overflow can occur in pretty.c::format_and_pad_commit() where a size_t is improperly stored as an int, and then added as an offset to a subsequent memcpy() call.

This overflow can be triggered directly by a user running a command which invokes the commit formatting machinery (e.g., git log --format=...). It may also be triggered indirectly through git-archive via the export-subst mechanism, which expands format specifiers inside of files within the repository during a git archive.

This integer overflow can result in arbitrary heap writes, which may result in remote code execution.

Credit for finding CVE-2022-41903 goes to Joern Schneeweisz of GitLab.

 

CVE-2022-23521
gitattributes are a mechanism to allow defining attributes for paths. These attributes can be defined by adding a .gitattributes file to the repository, which contains a set of file patterns and the attributes that should be set for paths matching this pattern.

When parsing gitattributes, multiple integer overflows can occur when there is a huge number of path patterns, a huge number of attributes for a single pattern, or when the declared attribute names are huge.

These overflows can be triggered via a crafted .gitattributes file that may be part of the commit history. Git silently splits lines longer than 2KB when parsing gitattributes from a file, but not when parsing them from the index. Consequentially, the failure mode depends on whether the file exists in the working tree, the index or both.

This integer overflow can result in arbitrary heap reads and writes, which may result in remote code execution.

Credit for finding CVE-2022-23521 goes to Markus Vervier and Eric Sesterhenn of X41 D-Sec.

네 그렇다고 합니다. 

 

 

https://docs.gitlab.com/ee/update/package/

Gitlab을 이미 잘 활용하고 있는 분들이라면 업그레이드를 몇 차례 해보셨을 것 같은데요, 한 번도 안해보셨는데 해야 하는 상황이라면 업그레이드 가이드를 잘 확인하고 진행하시기 바랍니다. 해당 가이드에서 현재 버전에서 목표 버전까지 한 번에 올려도 되는지, 몇 번의 버전을 거쳐서 최종 버전으로 가야 하는지 등에 대한 설명이 나와 있습니다. (이유는 잘 모르겠지만 시스템 구조가 바뀌거나 신설 / 없어지는 등의 폴더 / 명령어 등 때문이 아닐까 싶습니다.)

 

 

 


by mkdir chandler

 

 

 

 

 

728x90
반응형