T09 · Insecure Skill Coding Practices
- Location
QNNmodel.py:198- Finding
Hardcoded Quantum Cloud Credential
- Content
View full analysis
Vulnerability Details
File Location:
QNNmodel.py:198
Vulnerability Type: Hardcoded service credential
Risk Level: MediumVulnerable Code
python service=QCloudService("eca8012171babbc37d854e0f61d8240bbb2ed4d7801d5738c38b613e2d09cd073062576676394d74426c34786a4f4757")Technical Analysis
QNN_MTD.forwardQ()embeds a quantum-cloud service credential directly in source code. Every party with access to the Skill package can recover the credential without executing the project.Although the normal HTTP analysis path invokes
forward()rather thanforwardQ(), the secret remains exposed andforwardQ()will use it when called. Source-level exposure allows reuse independently of the Skill and therefore crosses the cloud account's authorization boundary.Attack Path
- An attacker downloads or otherwise obtains the Skill source.
- The attacker reads
QNNmodel.pyand extracts the credential passed toQCloudService. - The attacker supplies the credential to a compatible quantum-cloud client.
- Requests execute under the permissions and quotas assigned to the exposed credential.
No compromise of the normal HTTP endpoint is required.
Impact Assessment
An attacker may obtain the cloud-service privileges assigned to the credential. Depending on the provider-side permissions, this can permit unauthorized quantum jobs, resource or quota consumption, and charges against the associated account.
The exact provider-side privilege scope cannot be determined from the reviewed repository. No evidence indicates that this credential is used for covert exfiltration or that its exposure was intentional.
- Remediation
View remediation
Remediation Suggestions
- Immediately revoke and rotate the exposed credential.
- Remove the credential from source code and repository history.
- Obtain it at runtime from a protected environment variable or secret manager.
- Require explicit cloud-mode configuration and fail safely when no credential is configured.
- Restrict the replacement credential to the minimum required API operations, quotas, and resources.
- Add automated secret scanning to development and release workflows.
- Review provider-side usage logs for unauthorized activity involving the exposed credential.
