Skip to content

Format String Vulnerability

Description

The software uses a function that accepts a format string as an argument, but the format string originates from an external source. This can lead to buffer overflows, denial of service, or data representation problems.

Examples

Insecure Code

c
printf(user_input);

Secure Code

c
printf("%s", user_input);

Remediation

Validate and sanitize all external input used in format strings to prevent malicious formatting.

Rule Details

FieldValue
IDCODE-0644
CategoryInjection
SeverityCRITICAL
CWECWE-134
ConfidenceMEDIUM
ImpactHIGH
LikelihoodMEDIUM
ExploitabilityEASY
Tagsformat string, buffer overflow
OWASPN/A

References