Headline
GHSA-qqhq-8r2c-c3f5: nvdApiKey is logged in debug mode
Summary
The value of nvdApiKey
configuration parameter is logged in clear text in debug mode.
Details
The NVD API key is a kind of secret and should be treated like other secrets when logging in debug mode.
Expecting the same behavior as for several password configurations: just print ******
Note that while the NVD API Key is an access token for the NVD API - they are not that sensitive. The only thing an NVD API Token grants is a higher rate limit when making calls to publicly available data. The data available from the NVD API is the same whether you have an API Key or not.
PoC
The nvdApiKey is configured to use an environment variable; when running mvn -X dependency-check:check
the clear value is logged twice.
Impact
The NVD API key is a kind of secret and should not be exposed. If stolen, an attacker can use this key to obtain already public information.
UPDATE
The issue isn’t still resoved in 9.0.6:
Create a pom.xml
with the following configuration:
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>9.0.6</version>
<configuration>
<formats>
<format>HTML</format>
<format>XML</format>
<format>JSON</format>
</formats>
<failBuildOnCVSS>7</failBuildOnCVSS>
<autoUpdate>true</autoUpdate>
<skipProvidedScope>true</skipProvidedScope>
<nvdValidForHours>12</nvdValidForHours>
<knownExploitedEnabled>true</knownExploitedEnabled>
<knownExploitedUrl>https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json</knownExploitedUrl>
<nvdApiKey>foobar</nvdApiKey>
</configuration>
<executions>
<execution>
<id>OWASP-Check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and run mvn -X -B verify > check.txt 2>&1
then see that the API key ist still present in clear text: grep nvdApiKey check.txt
returns:
<nvdApiKey>foobar</nvdApiKey>
[DEBUG] (f) nvdApiKey = foobar
HINT: Can only verify maven, so didn’t edit other Affected products.
Summary
The value of nvdApiKey configuration parameter is logged in clear text in debug mode.
Details
The NVD API key is a kind of secret and should be treated like other secrets when logging in debug mode.
Expecting the same behavior as for several password configurations: just print ******
Note that while the NVD API Key is an access token for the NVD API - they are not that sensitive. The only thing an NVD API Token grants is a higher rate limit when making calls to publicly available data. The data available from the NVD API is the same whether you have an API Key or not.
PoC
The nvdApiKey is configured to use an environment variable; when running mvn -X dependency-check:check the clear value is logged twice.
Impact
The NVD API key is a kind of secret and should not be exposed. If stolen, an attacker can use this key to obtain already public information.
UPDATE
The issue isn’t still resoved in 9.0.6:
Create a pom.xml with the following configuration:
<build>
<plugins>
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>9.0.6</version>
<configuration>
<formats>
<format>HTML</format>
<format>XML</format>
<format>JSON</format>
</formats>
<failBuildOnCVSS>7</failBuildOnCVSS>
<autoUpdate>true</autoUpdate>
<skipProvidedScope>true</skipProvidedScope>
<nvdValidForHours>12</nvdValidForHours>
<knownExploitedEnabled>true</knownExploitedEnabled>
<knownExploitedUrl>https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json</knownExploitedUrl>
<nvdApiKey>foobar</nvdApiKey>
</configuration>
<executions>
<execution>
<id>OWASP-Check</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
and run mvn -X -B verify > check.txt 2>&1
then see that the API key ist still present in clear text: grep nvdApiKey check.txt
returns:
<nvdApiKey>foobar</nvdApiKey>
[DEBUG] (f) nvdApiKey = foobar
HINT: Can only verify maven, so didn’t edit other Affected products.
References
- GHSA-qqhq-8r2c-c3f5