Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Failure to properly null-terminate a character sequence that is passed to a library function that expects a string can result in buffer overflows and the execution of arbitrary code with the permissions of the vulnerable process. Null-termination errors can also result in unintended information disclosure.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

STR32-C

High

Probable

Medium

P12

L1

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
Compass/ROSE

 

 



Can detect some violations of this rule

Coverity
Include Page
Coverity_V
Coverity_V
STRING_NULLFully implemented
Klocwork
Include Page
Klocwork_V
Klocwork_V

NNTS.MIGHT
NNTS.MUST

NNTS.TAINTED

 


LDRA tool suite
Include Page
LDRA_V
LDRA_V

404 S, 600 S

Partially implemented

Parasoft C/C++test
Include Page
c:
Parasoft_V
c:
Parasoft_V
BD-PB-OVERFNZT
 

Polyspace Bug FinderR2016a

Invalid use of standard library string routine, Standard function call with incorrect arguments, Tainted NULL or non-null-terminated string

Standard library string function called with invalid arguments

Argument to a standard function does not meet requirements for use in the function

Argument is from an unsecure source and may be NULL or not NULL-terminated

 
PRQA QA-C++4.2 0145 
 

PVS-Studio6.22V692General analysis rule

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...

Key here (explains table format and definitions)

Taxonomy

Taxonomy item

Relationship

ISO/IEC TR 24772:2013String Termination [CMJ]Prior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TS 17961:2013Passing a non-null-terminated character sequence to a library function that expects a string [strmod]Prior to 2018-01-12: CERT: Unspecified Relationship
CWE 2.11CWE-119, Improper Restriction of Operations within the Bounds of a Memory Buffer2017-05-18: CERT: Rule subset of CWE
CWE 2.11CWE-123, Write-what-where Condition2017-06-12: CERT: Partial overlap
CWE 2.11CWE-125, Out-of-bounds Read2017-05-18: CERT: Rule subset of CWE
CWE 2.11CWE-170, Improper Null Termination2017-06-13: CERT: Exact

CERT-CWE Mapping Notes

Key here for mapping notes

...

  • Arbitrary writes that do not involve standard C library copying functions, such as strcpy()


Bibliography

[Seacord 2013] Chapter 2, "Strings" 
[Viega 2005]Section 5.2.14, "Miscalculated NULL Termination"

 


...