Skip to content

security(everything): gzip-file-as-resource fetches any URL incl. private/metadata IPs by default; get-env dumps all of process.env into model context #5130

Description

@Tardfyou

Summary

Two hardening gaps in the everything demo server that matter because demo servers get copied into real deployments:

  1. gzip-file-as-resource has no SSRF protection (tools/gzip-file-as-resource.ts): GZIP_ALLOWED_DOMAINS defaults to empty (line 21), and the domain check only applies "when configured" (line 150) — so by default any http/https URL is fetched, private/link-local/metadata addresses included, with redirects not re-checked. This contrasts with the fetch server, which ships default private-IP refusal. Demo code gets forked; the asymmetry propagates.
  2. get-env dumps the entire process.env into the tool result (tools/get-env.ts:28-38, JSON.stringify(process.env, null, 2)) — any prompt-injection source that can phrase a tool call reads every secret in the process (API keys included) straight into the model context. Even for a debug demo, an allowlist (GET_ENV_ALLOWED_KEYS) or opt-in flag would prevent the demo from becoming a deployment exfiltration primitive.

Suggestions

  • gzip: reuse the fetch server's _is_public_address default-deny when the allowlist is empty (or default the allowlist to public-suffix-only behavior);
  • get-env: default to a safe allowlist (or require explicit opt-in), and document both knobs in the server README.

Static analysis of main @ bbb701e; happy to PR either fix.


Chengzhi Yi (GitHub @Tardfyou) — yimou@hust.edu.cn

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions