hermes-agent/gateway/platforms
srojk34 16332af60b security(gateway): anchor api_server MEDIA tag resolution to safe paths
_resolve_media_to_data_urls's ad-hoc _MEDIA_TAG_RE matched any bare
token after MEDIA: (no absolute-path anchor) and read the resolved
path directly with no denylist. A relative/traversal path like
MEDIA:../../../../etc/passwd.png slipped through, and any image-
suffixed file the process could read (including under ~/.ssh, ~/.aws,
etc.) was base64-inlined into the API response if its path merely
appeared in the model's own final reply text.

Every other platform adapter's MEDIA: handling already goes through
two shared primitives in gateway/platforms/base.py:
  - MEDIA_TAG_CLEANUP_RE, which anchors the path to ~/, /, or a
    Windows drive letter plus a known deliverable extension.
  - validate_media_delivery_path, which resolves symlinks and rejects
    paths under the credential/system-path denylist.

Reuse both here instead of the local unanchored pattern and naive
Path().expanduser() resolution.
2026-07-03 03:27:47 -07:00
..
qqbot fix(gateway): fail-closed external-surface defaults + profile-aware multiplex authz 2026-07-01 03:56:28 -07:00
__init__.py
_http_client_limits.py
ADDING_A_PLATFORM.md
api_server.py security(gateway): anchor api_server MEDIA tag resolution to safe paths 2026-07-03 03:27:47 -07:00
base.py
bluebubbles.py
helpers.py
msgraph_webhook.py
signal.py
signal_format.py
signal_rate_limit.py
webhook.py fix(webhook): close per-delivery session at the true end of the run (#57423) 2026-07-02 17:39:09 -07:00
weixin.py fix(gateway): fail-closed external-surface defaults + profile-aware multiplex authz 2026-07-01 03:56:28 -07:00
whatsapp_cloud.py
whatsapp_common.py fix(gateway): fail-closed external-surface defaults + profile-aware multiplex authz 2026-07-01 03:56:28 -07:00
yuanbao.py fix(gateway): fail-closed external-surface defaults + profile-aware multiplex authz 2026-07-01 03:56:28 -07:00
yuanbao_media.py
yuanbao_proto.py
yuanbao_sticker.py