CVE-2024-45388 Arbitrary file read in the `/api/v2/simulation` endpoint in hoverfly (`GHSL-2023-274`)
공중제비의 `api/v2/simulation' 엔드포인트에서 읽은 임의의 파일(`GHSL-2023-274`)
설명
Hoverfly is a lightweight service virtualization/ API simulation / API mocking tool for developers and testers. The `/api/v2/simulation` POST handler allows users to create new simulation views from the contents of a user-specified file. This feature can be abused by an attacker to read arbitrary files from the Hoverfly server. Note that, although the code prevents absolute paths from being specified, an attacker can escape out of the `hf.Cfg.ResponsesBodyFilesPath` base path by using `../` segments and reach any arbitrary files. This issue was found using the Uncontrolled data used in path expression CodeQL query for python. Users are advised to make sure the final path (`filepath.Join(hf.Cfg.ResponsesBodyFilesPath, filePath)`) is contained within the expected base path (`filepath.Join(hf.Cfg.ResponsesBodyFilesPath, "/")`). This issue is also tracked as GHSL-2023-274.
Hoverfly는 개발자와 테스터를 위한 경량 서비스 가상화/ API 시뮬레이션/API 모의 도구입니다. `/api/v2/simulation` POST 핸들러를 사용하면 사용자가 지정한 파일의 내용으로부터 새로운 시뮬레이션 뷰를 생성할 수 있다. 이 기능은 공격자가 Hoverfly 서버에서 임의의 파일을 읽기 위해 악용할 수 있습니다. 코드가 절대 경로를 지정하지 못하게 하지만 공격자는 `../` 세그먼트를 사용하여 `hf.Cfg.ResponsesBodyFilesPath` 기본 경로에서 벗어나 임의의 파일에 도달할 수 있습니다. 이 문제는 python에 대한 경로 식 CodeQL 쿼리에 사용되는 제어되지 않는 데이터를 사용하여 발견되었습니다. 사용자는 최종 경로(`filepath.Join(hf.Cfg.ResponsesBodyFilesPath, filePath)`)가 예상 기본 경로(`filepath.Join(hf.Cfg.ResponsesBodyFilesPath, "/")`) 내에 포함되어 있는지 확인하는 것이 좋습니다. 이 문제는 GHSL-2023-274로도 추적됩니다.
영향 받는 제품 제품 1개
-
해결 버전 있음
SpectoLabs
hoverfly
영향 받는 버전
- 1.10.3 미만
해결 버전
- 1.10.3 이상
참고 자료 4건
- codeql.github.com https://codeql.github.com/codeql-query-help/go/go-path-injection (새 창)
- github.com https://github.com/spectolabs/hoverfly/blob/15d6ee9ea4e0de67aec5a41c28d21dc147243da0/core/handlers/v2/simulation_handler.go#L87 (새 창)
- github.com https://github.com/SpectoLabs/hoverfly/releases/tag/v1.10.3 (새 창)
- github.com https://github.com/SpectoLabs/hoverfly/security/advisories/GHSA-6xx4-x46f-f897 (새 창)