Versions Compared

Key

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

...

Violating the ODR causes undefined behavior, which can result in exploits as well as denial-of-service attacks. As shown in "Support for Whole-Program Analysis and the Verification of the One-Definition Rule in C++" [Quinlan 06], failing to enforce the ODR enables a virtual function pointer attack known as the VPTR exploit. In this exploit, an object's virtual function table is corrupted so that calling a virtual function on the object results in malicious code being executed. See the paper by Quinlan and colleagues for more details. However, note that to introduce the malicious class, the attacker must have access to the system building the code.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

DCL60-CPP

High

Unlikely

High

P3

L3

Automated Detection

Tool

Version

Checker

Description

Astrée

Include Page
Astrée_V
Astrée_V

type-compatibility
definition-duplicate
undefined-extern
undefined-extern-pure-virtual
external-file-spreading
type-file-spreading
Partially checked
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC++-DCL60
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

LANG.STRUCT.DEF.FDH
LANG.STRUCT.DEF.ODH

Function defined in header file
Object defined in header file
Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C++1067, C++1509, C++1510


LDRA tool suite
Include Page
LDRA_V
LDRA_V

286 S, 287 S

Fully implemented

PRQA QA-
Parasoft C/C++test

Include Page

PRQA QA-C++_VPRQA QA-C++_V1067
1509 

Parasoft_V
Parasoft_V

CERT_CPP-DCL60-a

A class, union or enum name (including qualification, if any) shall be a unique identifier

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C++: DCL60-CPPChecks for inline constraints not respected (rule partially covered)
RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
type-compatibility
definition-duplicate
undefined-extern
undefined-extern-pure-virtual
external-file-spreading
type-file-spreading
Partially checked

Related Vulnerabilities

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

Bibliography

[ISO/IEC 14882-2014]

Subclause 3.2, "One Definition Rule"

[Quinlan 2006]
 

...



...