Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-273:Improper Check for Dropped Privileges
Weakness ID:273
Version:v4.17
Weakness Name:Improper Check for Dropped Privileges
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Incomplete
Likelihood of Exploit:Medium
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.

▼Extended Description

If the drop fails, the product will continue to run with the raised privileges, which might provide additional access to unprivileged users.

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowed-with-ReviewC754Improper Check for Unusual or Exceptional Conditions
ChildOfAllowed-with-ReviewC271Privilege Dropping / Lowering Errors
PeerOfAllowedB252Unchecked Return Value
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 754
Name: Improper Check for Unusual or Exceptional Conditions
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 271
Name: Privilege Dropping / Lowering Errors
Nature: PeerOf
Mapping: Allowed
Type: Base
ID: 252
Name: Unchecked Return Value
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC265Privilege Issues
MemberOfProhibitedC748CERT C Secure Coding Standard (2008) Appendix - POSIX (POS)
MemberOfProhibitedV884CWE Cross-section
MemberOfProhibitedC962SFP Secondary Cluster: Unchecked Status Condition
MemberOfProhibitedC1011Authorize Actors
MemberOfProhibitedC1171SEI CERT C Coding Standard - Guidelines 50. POSIX (POS)
MemberOfProhibitedC1396Comprehensive Categorization: Access Control
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 265
Name: Privilege Issues
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 748
Name: CERT C Secure Coding Standard (2008) Appendix - POSIX (POS)
Nature: MemberOf
Mapping: Prohibited
Type:View
ID: 884
Name: CWE Cross-section
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 962
Name: SFP Secondary Cluster: Unchecked Status Condition
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1011
Name: Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1171
Name: SEI CERT C Coding Standard - Guidelines 50. POSIX (POS)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1396
Name: Comprehensive Categorization: Access Control
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-273Medium likelihood of exploit
MemberOfProhibitedBSBOSS-280Separation of Privilege Strategy
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-322Hide Activities (impact)
MemberOfProhibitedBSBOSS-332Gain Privileges or Assume Identity (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-273
Name: Medium likelihood of exploit
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-280
Name: Separation of Privilege Strategy
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-322
Name: Hide Activities (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-332
Name: Gain Privileges or Assume Identity (impact)
▼Relevant To View
Relevant to the view"Architectural Concepts - (1008)"
NatureMappingTypeIDName
MemberOfProhibitedC1011Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1011
Name: Authorize Actors
Relevant to the view"Weaknesses Addressed by the SEI CERT C Coding Standard - (1154)"
NatureMappingTypeIDName
MemberOfProhibitedC1171SEI CERT C Coding Standard - Guidelines 50. POSIX (POS)
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1171
Name: SEI CERT C Coding Standard - Guidelines 50. POSIX (POS)
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC265Privilege Issues
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 265
Name: Privilege Issues
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC962SFP Secondary Cluster: Unchecked Status Condition
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 962
Name: SFP Secondary Cluster: Unchecked Status Condition
▼Background Detail

In Windows based environments that have access control, impersonation is used so that access checks can be performed on a client identity by a server with higher privileges. By impersonating the client, the server is restricted to client-level security -- although in different threads it may have much higher privileges.

▼Common Consequences
ScopeLikelihoodImpactNote
Access ControlN/AGain Privileges or Assume Identity

If privileges are not dropped, neither are access rights of the user. Often these rights can be prevented from being dropped.

Access ControlNon-RepudiationN/AGain Privileges or Assume IdentityHide Activities

If privileges are not dropped, in some cases the system may record actions as the user which is being impersonated rather than the impersonator.

Scope: Access Control
Likelihood: N/A
Impact: Gain Privileges or Assume Identity
Note:

If privileges are not dropped, neither are access rights of the user. Often these rights can be prevented from being dropped.

Scope: Access Control, Non-Repudiation
Likelihood: N/A
Impact: Gain Privileges or Assume Identity, Hide Activities
Note:

If privileges are not dropped, in some cases the system may record actions as the user which is being impersonated rather than the impersonator.

▼Potential Mitigations
Phase:Architecture and Design
Mitigation ID: MIT-46
Strategy: Separation of Privilege
Effectiveness:
Description:

Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area.

Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

Note:


Phase:Implementation
Mitigation ID: MIT-53
Strategy:
Effectiveness: High
Description:

Check the results of all functions that return a value and verify that the value is expected.

Note:

Checking the return value of the function will typically be sufficient, however beware of race conditions (CWE-362) in a concurrent environment.


Phase:Implementation
Mitigation ID:
Strategy:
Effectiveness:
Description:

In Windows, make sure that the process token has the SeImpersonatePrivilege(Microsoft Server 2003). Code that relies on impersonation for security must ensure that the impersonation succeeded, i.e., that a proper privilege demotion happened.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

REALIZATION: This weakness is caused during implementation of an architectural security tactic.

This issue is likely to occur in restrictive environments in which the operating system or application provides fine-grained control over privilege management.

▼Applicable Platforms
Languages
Class: Not Language-Specific(Undetermined Prevalence)
▼Demonstrative Examples
Example 1

This code attempts to take on the privileges of a user before creating a file, thus avoiding performing the action with unnecessarily high privileges:

Language: ( code)
N/A

Language: C++(Bad code)
bool DoSecureStuff(HANDLE hPipe) { bool fDataWritten = false; ImpersonateNamedPipeClient(hPipe); HANDLE hFile = CreateFile(...); /../ RevertToSelf() /../ }

Language: ( code)
N/A

The call to ImpersonateNamedPipeClient may fail, but the return value is not checked. If the call fails, the code may execute with higher privileges than intended. In this case, an attacker could exploit this behavior to write a file to a location that the attacker does not have access to.

▼Observed Examples
ReferenceDescription
CVE-2006-4447
Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
CVE-2006-2916
Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
Reference: CVE-2006-4447
Description:
Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
Reference: CVE-2006-2916
Description:
Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
▼Affected Resources
  • System Process
▼Functional Areas
    ▼Weakness Ordinalities
    OrdinalityDescription
    Primary
    N/A
    Ordinality: Primary
    Description:
    N/A
    ▼Detection Methods
    Automated Static Analysis
    Detection Method ID:DM-14
    Description:

    Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

    Effectiveness:High
    Note:

    N/A

    ▼Vulnerability Mapping Notes
    Usage:Allowed
    Reason:Acceptable-Use
    Rationale:

    This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

    Comments:

    Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

    Suggestions:
    ▼Notes
    ▼Taxonomy Mappings
    Taxonomy NameEntry IDFitEntry Name
    CLASPN/AN/AFailure to check whether privileges were dropped successfully
    CERT C Secure CodingPOS37-CExactEnsure that privilege relinquishment is successful
    Software Fault PatternsSFP4N/AUnchecked Status Condition
    Taxonomy Name: CLASP
    Entry ID: N/A
    Fit: N/A
    Entry Name: Failure to check whether privileges were dropped successfully
    Taxonomy Name: CERT C Secure Coding
    Entry ID: POS37-C
    Fit: Exact
    Entry Name: Ensure that privilege relinquishment is successful
    Taxonomy Name: Software Fault Patterns
    Entry ID: SFP4
    Fit: N/A
    Entry Name: Unchecked Status Condition
    ▼Related Attack Patterns
    IDName
    ▼References
    Reference ID: REF-18
    Title: The CLASP Application Security Process
    Author: Secure Software, Inc.
    Section:
    Publication:
    Publisher:
    Edition:
    URL:https://cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf
    URL Date:2024-11-17
    Day:N/A
    Month:N/A
    Year:2005
    Details not found