strcpy

c · standard library
sink✓ Reviewed · 2026-09-04
RoleSink
WeaknessCWE-120 · CWE-787
WatchesArgument[0]
Kindbuffer-write
Confidencehigh
Corroboration3

Copies a NUL-terminated string without receiving the destination capacity, so a long source can overrun the buffer.

Argument map · what each slot does

The pack does not provide a callable signature for this record; the watched access path is shown directly.

ArgAccess pathPurposeWatched
Argument[0]Argument[0]The access path Atropos marks for this model.▲ sink
The weakness
CWE-120
Classic Buffer Overflow

Input is copied into an output buffer without checking that it fits.

CWE-787
Out-of-bounds Write

Data is written past the end or before the beginning of its intended buffer.

What goes wrong
Attacker's-eye view · buffer-write

Input longer than the destination overwrites adjacent memory or truncates unexpectedly.

// modeled boundary: Argument[0] strcpy(attacker_influenced_value);
To decide if this call is a bug, check
1Identify destination capacity.
2Check the write length before the call.
3Confirm truncation or rejection is explicit.
These checks require the surrounding codebase. The model names the boundary; it does not decide reachability or prove that a guard dominates every path.
Is this a bug in your code?Atropos stops here — by design

Atropos identifies Argument[0] as a buffer-write sink. It cannot see whether untrusted data reaches this call in your repository.

Lachesis is the codebase-level step: it traces reachability and guards for this symbol.

Check this symbol in Lachesis
Reviewed guidance

Safer direction: Use a length-aware API and make truncation or rejection explicit.

Unsafe shape
strcpy(buffer, input);
Safer shape
if (strlen(input) < sizeof buffer) memcpy(buffer, input, strlen(input) + 1);
The family · buffer-write

Across languages

No cross-language match.

What neutralizes it

No sanitizer of this kind is modeled.

Model facts · verbatim from the pack
RoleKindAccess pathModel IDConfidence
sinkbuffer-writeArgument[0]c.std.strcpy.a0high · corrob. 3
summarycopyArgument[1] -> Argument[0]c.std.strcpy.a1-a0high · corrob. 3
Referencesman7.org