🇰🇷 한글 설명
GetSimple CMS 3.3.15 이하 버전에서 발생하는 취약점으로, 인증 우회 및 부적절한 입력 검증을 통해 임의의 파일을 업로드할 수 있습니다. 공격자는 API 키와 관리자 정보를 탈취하여 인증을 우회한 뒤, theme-edit.php 파일을 통해 악성 PHP 코드를 실행할 수 있습니다.
💡 쉬운 설명
해커가 관리자 권한을 몰래 훔쳐서 웹사이트에 악성 파일을 올릴 수 있는 보안 구멍입니다. 이를 통해 웹사이트를 마음대로 조종하거나 정보를 빼낼 수 있습니다.
🇺🇸 원문 (English)
An issue was discovered in GetSimple CMS through 3.3.15. insufficient input sanitation in the theme-edit.php file allows upload of files with arbitrary content (PHP code, for example). This vulnerability is triggered by an authenticated user; however, authentication can be bypassed. According to the official documentation for installation step 10, an admin is required to upload all the files, including the .htaccess files, and run a health check. However, what is overlooked is that the Apache HTTP Server by default no longer enables the AllowOverride directive, leading to data/users/admin.xml password exposure. The passwords are hashed but this can be bypassed by starting with the data/other/authorization.xml API key. This allows one to target the session state, since they decided to roll their own implementation. The cookie_name is crafted information that can be leaked from the frontend (site name and version). If a someone leaks the API key and the admin username, then they can bypass authentication. To do so, they need to supply a cookie based on an SHA-1 computation of this known information. The vulnerability exists in the admin/theme-edit.php file. This file checks for forms submissions via POST requests, and for the csrf nonce. If the nonce sent is correct, then the file provided by the user is uploaded. There is a path traversal allowing write access outside the jailed themes directory root. Exploiting the traversal is not necessary because the .htaccess file is ignored. A contributing factor is that there isn't another check on the extension before saving the file, with the assumption that the parameter content is safe. This allows the creation of web accessible and executable files with arbitrary content.
📍 영향받는 시스템
GetSimple CMS 3.3.15 및 그 이전 버전
⚔️ 공격 벡터
인증 우회 후 theme-edit.php의 파일 업로드 기능을 이용한 임의 파일 업로드 및 경로 탐색
🛡️ 대응 방법
GetSimple CMS를 최신 버전으로 업데이트하고, Apache 설정에서 AllowOverride 지시어를 적절히 구성하여 보안을 강화하십시오.
🔧 검증 코드
명령어 실행 결과 'Vulnerable file exists'가 출력되면 해당 취약한 파일이 존재함을 의미합니다.
curl -s http://<target_ip>/admin/theme-edit.php | grep -q 'theme-edit.php' && echo 'Vulnerable file exists'