T09 · Insecure Skill Coding Practices
- Location
query_meetings.py:55- Finding
Hardcoded Credentials Transmitted Through an Insecure HTTP Login Page
- Content
View full analysis
Vulnerability Details
File Location:
query_meetings.py:55-57,query_meetings.py:94-109; credentials are also disclosed inSKILL.md:33-35
Vulnerability Type: Hardcoded secrets and plaintext authentication
Risk Level: CriticalVulnerable Code
python self.base_url = "http://gchportal.js-msa.gov.cn/cas/login" self.username = os.getenv("MSA_USERNAME", "lp@njmsa") self.password = os.getenv("MSA_PASSWORD", "@lp280033")python logger.info(f"Accessing login page: {self.base_url}") self.driver.get(self.base_url) time.sleep(2) username_input = self.wait.until( EC.presence_of_element_located((By.CSS_SELECTOR, "input[name='username'], input[type='text']")) ) password_input = self.driver.find_element( By.CSS_SELECTOR, "input[name='password'], input[type='password']" ) username_input.clear() username_input.send_keys(self.username) password_input.clear() password_input.send_keys(self.password)The original logging message in the source is written in Chinese; it is translated above without changing the executable behavior.
SKILL.mdalso publishes the same account and password in its system configuration section.Technical Analysis
The source code contains reusable default credentials. Environment variables only override these values; they do not prevent the embedded defaults from being used. Anyone who can obtain the project package can recover the username and password without executing the program.
The browser initially loads the authentication page through unencrypted HTTP. Even if the server subsequently redirects to HTTPS, the first HTTP response can be intercepted and modified by a network-positioned attacker. Such an attacker could prevent the redirect, replace the login form, change its submission endpoint, or inject browser-side code that captures the credentials.
This combines secret disclosure with a transport-security failure. The account ...[truncated 1330 chars]
- Remediation
View remediation
Remediation Suggestions
- Immediately disable or rotate the exposed account password and review its authentication history.
- Remove the username and password from source code, documentation, release artifacts, and version history.
- Require credentials to be supplied through a managed secret store or protected environment variables. Abort execution if either value is absent.
- Replace the HTTP URL with the authoritative HTTPS endpoint.
- Configure the browser workflow to reject certificate errors, insecure redirects, and any downgrade to HTTP.
- Use a dedicated read-only service account restricted to the minimum meeting-query permissions.
- Add automated secret scanning to the development and release pipeline.
- Review whether the same password was reused on other systems and rotate it wherever applicable.
