Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

STR34-C

medium

probable

medium

P8

L2

Automated Detection

Tool

Version

Checker

Description

Section

LDRA tool suite

Include Page
c:LDRA_Vc:
LDRA_V
Section

434 S

Section

Fully Implemented

Section

Fortify SCA

Section

V. 5.0

 

Section

Can detect violations of this rule with CERT C Rule Pack.

Section

Compass/ROSE

 

 

Section

Can detect violations of this rule when checking for violations of guideline INT07-C. Use only explicitly signed or unsigned char type for numeric values.

GCC

2.95 and later

-Wchar-subscripts

Detects objects of type char used as array indices.

Section

ECLAIR

Include Page
c:ECLAIR_Vc:
ECLAIR_V
Section

charcast

Section

Fully Implemented

Related Vulnerabilities

...

[CVE-2009-0887|http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2009-0887] results from a violation of this rule. In Linux PAM (up to version 1.0.3), the {{libpam}} implementation of strtok casts a (potentially signed) character to an integer, for use as an index to an array. An attacker can exploit this by inputting a string with non-ASCII characters, causing the cast to result in a negative index and accessing memory outside of the array \[ [xorl 2009|http://xorl.wordpress.com/2009/03/26/cve- 2009-0887-linux-pam-singedness-issue/]\].

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

...

MITRE CWE: CWE-704, "Incorrect Type Conversion or Cast"

Bibliography

...

\[[xorl 2009|AA. Bibliography#xorl 2009] \] ["CVE-2009-0887: Linux-PAM Singedness Issue"|http://xorl.wordpress.com/2009/03/26/cve-2009-0887-linux-pam-singedness-issue/]

...

STR33-C. Size wide character strings correctly      07. Characters and Strings (STR)      STR35-C. Do not copy data from an unbounded source to a fixed-length array