CWE-474: Use of Function with Inconsistent Implementations

BaseDraft

The code uses a function that has inconsistent implementations across operating systems and versions.

View on MITRE
Back to CWE Lookup

Extended Description

The use of inconsistent implementations can cause changes in behavior when the code is ported or built under a different environment than the programmer expects, which can lead to security problems in some cases. The implementation of many functions varies by platform, and at times, even by different versions of the same platform. Implementation differences can include: Slight differences in the way parameters are interpreted leading to inconsistent results. Some implementations of the function carry significant security risks. The function might not be defined on all platforms. The function might change which return codes it can provide, or change the meaning of its return codes.

Technical Details

Structure
Simple

Applicable To

Languages
CPHPNot Language-Specific
Platforms

Frequently Asked Questions

What is CWE-474: Use of Function with Inconsistent Implementations?+

CWE-474: Use of Function with Inconsistent Implementations is a Common Weakness Enumeration (CWE) entry maintained by MITRE. The code uses a function that has inconsistent implementations across operating systems and versions. The use of inconsistent implementations can cause changes in behavior when the code is ported or built under a different environment than the programmer expects, which can lead to security problems in some cases. The implementation of many functions varies by platform, and at times, even by different versions of the same platform. Implementation differences can include: Slight differences in the way parameters are interpreted leading to inconsistent results. Some implementations of the function carry significant security risks. The function might not be defined on all platforms. The function might change which return codes it can provide, or change the meaning of its return codes.

What are the security consequences of Use of Function with Inconsistent Implementations?+

If exploited, CWE-474 (Use of Function with Inconsistent Implementations) it can compromise Other, leading to outcomes such as Quality Degradation and Varies by Context.

How do you prevent or mitigate Use of Function with Inconsistent Implementations?+

Recommended mitigations for CWE-474 include: Do not accept inconsistent behavior from the API specifications when the deviant behavior increase the risk level.

Which programming languages are affected by Use of Function with Inconsistent Implementations?+

CWE-474 commonly affects C, PHP and Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What is the difference between a CWE and a CVE?+

A CWE (Common Weakness Enumeration) like CWE-474 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.

Learn More