T09 · Insecure Skill Coding Practices
- Location
scripts/jenkins_handler.py:15- Finding
Jenkins Credentials Are Transmitted over Plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
scripts/jenkins_handler.py:15-18, 33-45, 61-69
Vulnerability Type: Cleartext transmission of authentication credentials
Risk Level: HighVulnerable Code
python JENKINS_URL = os.getenv("JENKINS_URL", "http://jks.huimei-inc.com") USERNAME = os.getenv("JENKINS_USERNAME", "jiaofu") API_TOKEN = os.getenv("JENKINS_API_TOKEN", "") PASSWORD = os.getenv("JENKINS_PASSWORD", "")python if try_api_token_first and API_TOKEN: try: test_url = f"{JENKINS_URL}/api/json" response = session.get( test_url, auth=(USERNAME, API_TOKEN), timeout=10 ) if response.status_code == 200: return (USERNAME, API_TOKEN) except Exception: pass if PASSWORD: return (USERNAME, PASSWORD)python headers = { "Authorization": f"Basic {base64.b64encode(f'{auth[0]}:{auth[1]}'.encode()).decode()}" }Technical Analysis
The default Jenkins endpoint uses unencrypted HTTP. The
requestsauthentication tuple causes the username and API token or password to be sent using HTTP Basic authentication. Basic authentication only Base64-encodes the credentials; it does not provide encryption.The Base64 operation identified by the pre-scan is used to construct a conventional HTTP Basic Authorization header. There is no evidence that this encoded value is printed or used as a covert output channel. Nevertheless, sending that header over HTTP exposes the underlying credential to anyone capable of observing or manipulating network traffic.
The insecure HTTP endpoint is also documented in
SKILL.md, making insecure deployment the default rather than an exceptional configuration.Attack Path
- A user configures or accepts the default
http://jks.huimei-inc.comendpoint. - The Skill sends a Jenkins API request using a username and API token or pas ...[truncated 1274 chars]
- A user configures or accepts the default
- Remediation
View remediation
Remediation Suggestions
- Change the default endpoint to an HTTPS URL with a valid certificate.
- Reject any configured
JENKINS_URLthat does not use thehttpsscheme. - Keep TLS certificate verification enabled and do not introduce
verify=False. - Remove all plaintext HTTP Jenkins examples from
SKILL.md. - Use a dedicated, revocable Jenkins API token instead of an account password.
- Assign the Jenkins service account only the job-read, build-trigger, build-status, and artifact-read permissions required for approved jobs.
- Restrict the account from administrative actions, credential management, script-console access, and unrelated deployment jobs.
- Rotate any credential that may already have traversed the plaintext endpoint.
- Consider pinning the expected Jenkins hostname and applying outbound network controls so credentials cannot be sent to an arbitrary environment-configured host.
