Xml Authorization Header With Basic Token
Description
Detects exposed Basic Authentication tokens in JMX header configurations. Basic Auth credentials are only base64 encoded and not encrypted, making them vulnerable to interception and credential exposure if captured by attackers.
Detection Strategy
• Review configuration files for JMX header configurations
• Look for 'stringprop' elements with name attribute set to 'header.value'
• Check if the header value contains 'basic' authentication token
• Flag configurations where Basic Authentication headers are specified in clear text
Vulnerable code example
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2">
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">Basic 12jlkasd123{ada+</stringProp> <!-- VULNERABLE: Hard-coded Basic auth credentials expose sensitive data -->...✅ Secure code example
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2">
<hashTree>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers">
<elementProp name="" elementType="Header">
<stringProp name="Header.name">Authorization</stringProp>
<stringProp name="Header.value">${__env(AUTH_BASIC_TOKEN)}</stringProp> <!-- Safe: Uses environment variable instead of hardcoded credentials -->...Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.