An environment variable is a runtime value passed to a program by the operating system or shell. It is commonly used for configuration such as hostnames, feature flags, and temporary credentials. Because it is easy to set and inherit into child processes, it is convenient for automation and developer workflows.
In cyber security, environment variables matter because they are not a secure vault. Secrets placed there can leak through logs, crash dumps, debug output, process inspection, or tools that print the runtime environment. Attackers who gain local access may search these values to find API keys, tokens, or cloud credentials. Defenders use them carefully for short-lived or scoped secrets, but they should pair them with vaults, federated identity, and endpoint monitoring rather than rely on them for long-term storage.


