You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(security): close three HIGH-severity API issues (#224)
* fix(security): close three HIGH-severity API issues
* Thumbnail ``color`` / ``size`` / ``radius`` are now whitelisted before
the ``color`` string reaches the cache-filename construction. Values
like ``?color=../../evil`` previously escaped the thumbnail cache
directory via ``Path /`` concatenation and let PIL write a .png to an
arbitrary location.
* ``POST /version/update`` and ``POST /version/restart`` now honour
``PHOTOMAP_INLINE_UPGRADE`` server-side (previously only the UI
button was hidden) and require an ``X-Requested-With: photomap``
header, which forces a CORS preflight that we do not answer — so a
cross-origin simple POST from any page the user visits can no longer
silently trigger a pip install or kill the server. The frontend
already sends the header from ``about.js``.
* InvokeAI settings reject URLs whose scheme is not ``http``/``https``
(and empty-host values like ``http://``) so the config field cannot
be flipped to ``file://`` or ``javascript:`` and used as an SSRF
pivot from ``/status``, ``/boards``, ``/recall`` or
``/use_ref_image``. The ``queue_id`` field is constrained to
``[A-Za-z0-9_.-]{1,64}`` so a request body can't splice ``../`` into
the outbound path and reach arbitrary endpoints on the configured
backend.
New tests: tests/backend/test_thumbnail_validation.py,
tests/backend/test_upgrade_router.py, plus SSRF / queue-id coverage
appended to tests/backend/test_invoke_router.py. 175 backend + 239
frontend tests pass; ruff / eslint / prettier clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(security): close add_album → serve_image arbitrary-file-read chain
``POST /add_album`` accepts arbitrary absolute ``image_paths``, and
``serve_image`` / ``get_image_by_name`` previously returned any file
under those paths as long as ``validate_image_access``'s
``is_relative_to`` guard passed — the guard checks *location* only,
not *type*. A caller could therefore create an album with
``image_paths=["/etc"]`` and read ``/etc/passwd`` via
``GET /images/<key>/passwd``.
Both endpoints now require the resolved file's suffix to be in
``SUPPORTED_EXTENSIONS`` (the same allowlist the indexer uses).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(backend): PHOTOMAP_INLINE_UPGRADE env variable now works as documented
* fix(settings): surface InvokeAI URL validation and reachability errors inline
Previously the settings panel silently dropped the 400 returned for invalid
URLs (e.g. file:// schemes) and only flipped auth-row visibility for
unreachable backends, leaving the user with no feedback. The hint under the
URL field now turns red with a warning icon and shows the backend's detail
for: invalid scheme/host, unreachable host, and reachable-but-not-InvokeAI
servers. Restores the default hint once the URL is valid and reachable.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments