CWE一覧に戻る
CWE-526

環境変数への機密情報の暗号化保存

Cleartext Storage of Sensitive Information in an Environment Variable
脆弱性 作成中
JA

この製品は、暗号化されていない機密情報を保存するために環境変数を使用します。

環境変数に格納された情報は、依存関係が実行される子プロセスやクラウド環境のサーバーレス関数など、実行コンテキストを持つ他のプロセスからアクセスできる。環境変数の内容は、メッセージ、ヘッダー、ログファイル、その他の出力に挿入することもできます。多くの場合、これらの他の依存関係は、問題の環境変数を使用する必要がない。環境変数を開示する弱点は、この情報を暴露する可能性がある。

EN

The product uses an environment variable to store unencrypted sensitive information.

Information stored in an environment variable can be accessible by other processes with the execution context, including child processes that dependencies are executed in, or serverless functions in cloud environments. An environment variable's contents can also be inserted into messages, headers, log files, or other outputs. Often these other dependencies have no need to use the environment variable in question. A weakness that discloses environment variables could expose this information.

Scope: Confidentiality / Impact: Read Application Data
Encrypt information stored in the environment variable to protect it from being exposed to an unauthorized user. If encryption is not feasible or is considered too expensive for the business use of the application, then consider using a properly protected configuration file instead of an environment variable. It should be understood that unencrypted information in a config file is also not guaranteed to be protected, but it is still a better choice, because it reduces attack surface related to weaknesses such as CWE-214. In some settings, vaults might be a feasible option for safer data transfer. Users should be notified of the business choice made to not protect the sensitive information through encryption.
If the environment variable is not necessary for the desired behavior, then remove it entirely, or clear it to an empty value.
MITRE公式ページ — CWE-526