# Hard-coded product credentials

A reusable credential is embedded in source, history, a release, or a default configuration. Distinguish a shared built-in credential from an accidentally committed deployment credential when assigning the weakness.

**Candidate CWE:** [CWE-798](https://cwe.mitre.org/data/definitions/798.html)

## Test hypothesis

Run `gitleaks git ./repo --redact=100 --report-format json --report-path ./evidence/secrets.json` against a local clone, then inspect surrounding code and supported setup. Check whether a shipped synthetic lab accepts the documented shared default. For a discovered real token, establish ownership and exposure from context; ask the owner to validate and rotate it rather than using it.

## Evidence required

Repository path and commit, first/last observed exposure, credential purpose, shipped/default use where proved, and a redacted fingerprint. Never attach the complete credential. Separate proven lab authentication from unknown validity of a deployment secret. Apply CWE-798 only where the credential is embedded in product authentication or outbound credential use. For accidental repository disclosure, use the separate exposed-repository-secret entry and classify the actual exposure root cause.

## Rule out false positives

Test keys, intentionally public identifiers, revoked values, example-only placeholders, and fixtures not shipped in the product. An entropy match alone is insufficient.

## Playbook and command references

- [OSS lab: pin, install, prove, reset](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/oss-lab-reproduction.html) — Turn an eligible release into a repeatable synthetic environment with preserved versions, realistic controls, and an explicit reset recipe.
- [Source review: entry point to protected operation](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/source-dataflow.html) — Trace attacker control and authorization through handlers, services, queues, and sensitive operations; promote only reachable violations of a stated invariant.
- [CI and releases: trace untrusted input into privileged work](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/supply-chain-ci.html) — Audit workflow events, shell interpolation, untrusted builds, artifact consumers, and release identity as one privilege chain.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=OSS%20lab%3A%20pin%2C%20install%2C%20prove%2C%20reset)

## Referenced by these target playbooks

[OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html) · [Desktop & extensions](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/desktop.html) · [Mobile](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/mobile.html) · [Cloud & containers](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/cloud.html) · [AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html)

## Report checklist

- [ ] Capture the affected version, configuration, identities, and object ownership.
- [ ] Preserve a valid baseline and a negative control.
- [ ] Reproduce the forbidden data access, action, or state change on controlled fixtures.
- [ ] Explain the intended security rule and why the observed behavior violates it.
- [ ] State prerequisites, uncertainty, cleanup, and the smallest demonstrated impact.

## Conditional ATT&CK mapping

- [T1552.001 · Unsecured Credentials: Credentials In Files](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1552-001) — **Only if:** The tested path retrieves credentials from insufficiently protected configuration, source, log, archive, or other files; retain only redacted evidence and location details. **Not established by:** A high-entropy string, sample credential, or accessible file without authentication material is insufficient. Reading arbitrary non-secret data is a different behavior.

## Primary references

- [Gitleaks official documentation](https://github.com/gitleaks/gitleaks)
- [MITRE CWE-798](https://cwe.mitre.org/data/definitions/798.html)

[Back to the complete vulnerability catalog](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities.html)
