environment variable leakage in error reporting
When a process using the Seneca Node.js toolkit crashes, its error output includes a dump of all environment variables. An attacker who can read those logs, or find them republished in public bug reports, could obtain private credentials such as cloud access keys.
- Triaged in 39 hours
- Fixed in 5 months
- Disclosed after 5 months
NOTE! Thanks for submitting a report! Please replace all the [square] sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!
I would like to report the leak of environment variables in https://github.com/senecajs/seneca It make a user indavertely leak private credentials (such as AWS keys) to public spaces.
Module
module name: [MODULE NAME]
version: [MODULE VERSION]
npm page: https://www.npmjs.com/package/[MODULE NAME]
Module Description
A Node.js toolkit for Microservice architectures
Module Stats
Replace stats below with numbers from npm’s module page:
1711 downloads in the last day 7199 downloads in the last week 29241 downloads in the last month
Vulnerability
Vulnerability Description
Description about how the vulnerability was found and how it can be exploited, how it harms package users (data modification/lost, system access, other.
When a process using Seneca crashes, it prints out all of its environment variables. These are typically picked up by log monitoring system, and they might end up in less secured placed. As a result, it can end up in public bug reports, such as https://github.com/senecajs/seneca-transport/issues/88.
Steps To Reproduce:
var seneca = require('seneca')()
seneca.die()
Patch
diff --git a/lib/common.js b/lib/common.js
index ef3e398..e992cd6 100644
--- a/lib/common.js
+++ b/lib/common.js
@@ -339,10 +339,7 @@ exports.makedie = function(instance, ctxt) {
process.arch +
', platform=' +
process.platform +
- (!full ? '' : ', path=' + process.execPath) +
- ', argv=' +
- Util.inspect(process.argv).replace(/\n/g, '') +
- (!full ? '' : ', env=' + Util.inspect(process.env).replace(/\n/g, ''))
+ (!full ? '' : ', path=' + process.execPath)
var when = new Date()
Supporting Material/References:
Wrap up
Select Y or N for the following statements:
- I contacted the maintainer to let them know: Y
- I opened an issue in the related repository: N
Hunter's comments and funny memes goes here
Impact
Access to cloud accounts. I got a 55$ bill out of this.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The crash handler built its diagnostic message by including a full dump of the process environment, so secrets were written into error output.
Impact
Environment variables, potentially including cloud credentials, could be exposed through crash logs and public bug reports, and the reporter says this resulted in a cloud bill.
What the attacker needed
Application uses Seneca; crash output is logged or shared publicly
The fix
The patch removes the environment and argument dumps from the crash message, leaving only the executable path.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Programs often keep secrets, like passwords and cloud access keys, in environment variables, which are settings passed in when the program starts. Seneca printed all of these settings whenever it crashed, so anyone who saw the crash output, for example in a log system or a public bug report, could read the secrets. The reporter says this led to unauthorised use of a cloud account.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.