🇰🇷 한글 설명
OpenPLC Runtime v3의 레거시 웹 UI 프로그램 업로드 과정에서 인증된 사용자가 임의의 파일을 작성할 수 있는 취약점이 발견되었습니다. 공격자가 조작된 파일명을 사용하여 시스템 내 임의 경로에 파일을 저장할 수 있으며, 특히 소스 코드 디렉토리에 악성 C++ 파일을 삽입하여 컴파일 시 임의 코드를 실행할 수 있습니다.
💡 쉬운 설명
로그인이 가능한 사용자가 시스템의 중요한 폴더에 몰래 악성 파일을 심을 수 있는 보안 약점입니다. 이 파일을 이용해 시스템이 정상적인 작업을 수행하는 척하면서 공격자의 명령을 실행하게 만들 수 있습니다.
🇺🇸 원문 (English)
OpenPLC Runtime v3 contains an authenticated arbitrary file write
vulnerability in the legacy web UI program‑upload workflow. The
application stores an attacker‑supplied filename (prog_file) directly
into the Programs.File database field and later uses this value as the
destination path for an uploaded file without validating or restricting
the path. Because Python os.path.join() honors attacker‑controlled
absolute paths, an authenticated user can write arbitrary files anywhere
writable by the OpenPLC webserver process. In the default build
pipeline, all C++ source files within the OpenPLC runtime core directory
are automatically compiled into the executable runtime binary. By
writing a malicious .cpp file into this directory, an authenticated
attacker can escalate the arbitrary file write into arbitrary native
code execution when the operator triggers a normal program compilation
and runtime start.
📍 영향받는 시스템
OpenPLC Runtime v3
⚔️ 공격 벡터
인증된 사용자가 파일 업로드 시 경로 조작(Path Traversal)을 통해 시스템 디렉토리에 악성 소스 코드를 삽입
🛡️ 대응 방법
파일 업로드 시 파일명 검증 로직을 추가하고, 업로드 경로를 특정 디렉토리로 제한하며, 웹 서버 프로세스의 쓰기 권한을 최소화해야 합니다.
🔧 검증 코드
명령어 결과로 OpenPLC v3 관련 경로가 출력되면 해당 취약한 버전이 설치되어 있을 가능성이 높습니다.
find / -name "OpenPLC" 2>/dev/null | grep "v3"