🇰🇷 한글 설명
Langflow 코드 인젝션 원격 코드 실행 취약점. 이 취약점을 이용하여 원격 공격자는 영향을 받는 Langflow 설치에서 임의의 코드를 실행할 수 있으며, 이를 악용하기 위해 인증은 필요하지 않다.
💡 쉬운 설명
Langflow의 코드 검증 엔드포인트에서 사용자 입력 문자열의 적절한 검증이 이루어지지 않아 발생하는 취약점으로, 공격자는 이를 통해 루트 권한으로 코드를 실행할 수 있다. Langflow를 사용하는 시스템은 이 취약점으로 인해 심각한 공격에 노출될 수 있다.
🇺🇸 원문 (English)
Langflow code Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Langflow. Authentication is not required to exploit this vulnerability.
The specific flaw exists within the handling of the code parameter provided to the validate endpoint. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of root.
. Was ZDI-CAN-27322.
⚔️ 공격 벡터
원격 공격자에 의한 Langflow 코드 인젝션
🛡️ 대응 방법
Langflow의 최신 보안 패치를 적용하고, 코드 검증 엔드포인트에 대한 입력 검증을 강화한다.
🔧 검증 코드
로컬에서 Langflow의 코드 검증 엔드포인트에 접근하여 특정 파라미터를 전송하고, 응답 코드를 확인하는 방법으로 취약점 여부를 점검한다. 이 코드를 실행하기 위해 Python과 requests 라이브러리가 필요하다. 또한, Langflow가 설치되어 있고, 코드 검증 엔드포인트가 활성화되어 있어야 한다.
import requests
response = requests.get('https://example.com/validate', params={'code': 'python code'})
if response.status_code == 200:
print({"result": "취약", "reason": "원격 코드 실행 성공"})
else:
print({"result": "양호", "reason": "원격 코드 실행 실패"})