🇰🇷 한글 설명
QWED 오픈소스 AI 검증 인프라의 5.1.2 미만 버전에서 발생하는 취약점으로, 사용자 입력 수학 표현식이 적절한 제한 없이 SymPy의 parse_expr() 함수로 전달됩니다. 공격자는 이를 통해 Python의 eval() 기능을 악용하여 API 서버 프로세스에서 임의의 코드를 실행할 수 있습니다.
💡 쉬운 설명
수학 계산을 처리하는 과정에서 검증되지 않은 명령어가 섞여 들어올 수 있는 보안 구멍이 발견되었습니다. 해커가 이 구멍을 이용해 서버에 몰래 명령을 내려 파일을 읽거나 삭제하고 시스템을 장악할 수 있습니다.
🇺🇸 원문 (English)
QWED is open-source AI verification infrastructure for deterministic verification of LLM outputs, tool calls, code, schemas, and agent state before production execution. Prior to 5.1.2, the qwed package passes caller-controlled math expressions directly to SymPy parse_expr() without restricted global_dict and local_dict namespaces, allowing Python eval() to resolve builtins and execute arbitrary Python code in the API server process. In src/qwed_new/api/main.py, POST /verify/math is protected by get_current_tenant but accepts any valid tenant API key, reads the expression field, applies only a cosmetic re.sub(r'(\d)(()', r'\1*\2', expression) normalization, and passes the result to parse_expr(). In src/qwed_new/core/batch.py, POST /verify/batch sends math items through batch_service.create_job(), stores item.query verbatim, and _verify_item() passes VerificationType.MATH input to parse_expr() without sanitization. The default-enabled POST /auth/signup endpoint allows anyone to create a standard tenant account, POST /auth/api-keys issues an x-api-key, and either vulnerable path can then be used to read or write files, modify data, execute operating system commands, terminate the service, and compromise other tenants in a shared deployment. This issue is fixed in version 5.1.2.
📍 영향받는 시스템
QWED (qwed package) version < 5.1.2
⚔️ 공격 벡터
API 서버의 /verify/math 또는 /verify/batch 엔드포인트에 악의적인 Python 코드가 포함된 수학 표현식을 전송
🛡️ 대응 방법
QWED 패키지를 최신 버전인 5.1.2 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 5.1.2보다 낮으면 취약한 상태입니다.
pip show qwed | grep Version