# Use after free in a public API or parser lifecycle

Code uses an object after its lifetime has ended, often across callbacks, error handling, reference counting, or asynchronous operations.

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

## Test hypothesis

Model documented ownership for create/use/callback/release. Build a minimal valid call sequence that triggers the stale access under ASan. Reset state between cases; compare the same sequence on a fixed build and distinguish implementation lifetime failures from caller misuse.

## Evidence required

Creation, free, and use stack traces; minimized call sequence/input; object ownership contract; revision; and realistic consumer path. A crash supports the lifetime defect, while privilege or code-execution impact needs additional evidence.

## Rule out false positives

The caller deliberately calls an API after its documented destruction point, omits a required reference, or the harness incorrectly frees borrowed memory.

## Playbook and command references

- [Libraries and parsers: bounded fuzzing to a minimal reproducer](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/parser-fuzzing.html) — Build a realistic local harness, instrument the target, bound fuzzing resources, and turn unique faults into defensible library or consumer reports.
- [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.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=Libraries%20and%20parsers%3A%20bounded%20fuzzing%20to%20a%20minimal%20reproducer)

## 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) · [Network services](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/network.html) · [Hardware & firmware](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/hardware.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

- [T1203 · Exploitation for Client Execution](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1203) — **Only if:** A client-application vulnerability executes attacker-controlled code when the client processes a file, document, or other content; identify the affected desktop/client process. **Not established by:** A parser crash alone is insufficient. Ordinary web XSS is not automatically a native client execution exploit, and Mobile uses separate technique IDs.
- [T1068 · Exploitation for Privilege Escalation](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html#T1068) — **Only if:** A software vulnerability crosses a privilege boundary into a more privileged process or security context; record before/after identities and the vulnerable component. **Not established by:** Do not infer this from any feature named admin, a writable path alone, or a kernel version match. Application role authorization flaws need their own contextual analysis.

## Primary references

- [MITRE CWE-416](https://cwe.mitre.org/data/definitions/416.html)
- [Clang AddressSanitizer](https://clang.llvm.org/docs/AddressSanitizer.html)

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