Tainted flow: 'BASE_URL' from os.environ.get (line 29, credential/environment) → requests.post (network output)
Critical
- Category
- Data Flow
- Content
def embed(texts: list[str], api_key: str) -> np.ndarray: """Get embeddings from SiliconFlow API.""" resp = requests.post( f"{BASE_URL}/embeddings", headers={"Authorization": f"Bearer {api_key}"}, json={"model": MODEL, "input": texts, "encoding_format": "float"},- Confidence
- 93% confidence
- Finding
- The code allows the embedding endpoint to be fully overridden by the SILICONFLOW_BASE_URL environment variable while also sending the Bearer API key in the Authorization header and user-provided text in the request body. In an agent or multi-tenant runtime where environment variables can be influenced, this can redirect secrets and sensitive content to an attacker-controlled server, making the external transmission materially dangerous.
