Arbitrary file read in the `/api/v2/simulation` endpoint in hoverfly (`GHSL-2023-274`)
Description
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.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/spectolabs/hoverflyGo | < 1.10.3 | 1.10.3 |
github.com/SpectoLabs/hoverflyGo | < 1.10.3 | 1.10.3 |
Affected products
2- SpectoLabs/hoverflyv5Range: < 1.10.3
Patches
Vulnerability mechanics
References
6- github.com/advisories/GHSA-6xx4-x46f-f897ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-45388ghsaADVISORY
- codeql.github.com/codeql-query-help/go/go-path-injectionghsax_refsource_MISCWEB
- github.com/SpectoLabs/hoverfly/releases/tag/v1.10.3ghsax_refsource_MISCWEB
- github.com/SpectoLabs/hoverfly/security/advisories/GHSA-6xx4-x46f-f897ghsax_refsource_CONFIRMWEB
- github.com/spectolabs/hoverfly/blob/15d6ee9ea4e0de67aec5a41c28d21dc147243da0/core/handlers/v2/simulation_handler.goghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.