CWE-365
Weakness ProhibitedDEPRECATED: Race Condition in Switch
Abstraction: Base · Status: Deprecated
This entry has been deprecated. There are no documented cases in which a switch's control expression is evaluated more than once.
Mapping guidance
This CWE has been deprecated.
See description and name for possible suggestions of other CWEs to consider.
Notes
Other
It is likely that this entry was initially created based on a misinterpretation of the original source material. The original source intended to explain how switches could be unpredictable when using threads, if the control expressions used data or variables that could change between execution of different threads. That weakness is already covered by CWE-367.
Despite the ambiguity in the documentation for some languages and compilers, in practice, they all evaluate the switch control expression only once. If future languages state that the code explicitly evaluates the control expression more than once, then this would not be a weakness, but the language performing as designed.
Content history
Many members of the CWE community contributed important feedback supporting deprecation of this entry. The contribution date reflects the first public request for comment; much feedback was received both before and after that date.
updated Time_of_Introduction
updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings
updated Relationships, Taxonomy_Mappings
updated Relationships
updated Common_Consequences
updated Common_Consequences
updated Demonstrative_Examples, References, Relationships
updated Common_Consequences, Description, Other_Notes, Potential_Mitigations
updated Relationships, Taxonomy_Mappings
updated Demonstrative_Examples
updated Relationships, Taxonomy_Mappings
updated Description, References, Relationships
updated Applicable_Platforms, Common_Consequences, Demonstrative_Examples, Description, Likelihood_of_Exploit, Name, Potential_Mitigations, References, Relationships, Taxonomy_Mappings, Time_of_Introduction, Type
updated Mapping_Notes
updated Description, Other_Notes
1 vulnerability references this CWE, most recent first.
GHSA-QX34-47FC-VV79
Vulnerability from github – Published: 2023-02-08 06:30 – Updated: 2023-02-16 21:53Race Condition in Switch in GitHub repository answerdev/answer prior to 1.0.4.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/answerdev/answer"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-0739"
],
"database_specific": {
"cwe_ids": [
"CWE-362",
"CWE-365"
],
"github_reviewed": true,
"github_reviewed_at": "2023-02-08T22:33:00Z",
"nvd_published_at": "2023-02-08T05:15:00Z",
"severity": "MODERATE"
},
"details": "Race Condition in Switch in GitHub repository answerdev/answer prior to 1.0.4.",
"id": "GHSA-qx34-47fc-vv79",
"modified": "2023-02-16T21:53:07Z",
"published": "2023-02-08T06:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-0739"
},
{
"type": "WEB",
"url": "https://github.com/answerdev/answer/commit/1ee34b884b905d14d4db457563176b77a974b992"
},
{
"type": "PACKAGE",
"url": "https://github.com/answerdev/answer"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/93d7fac9-50be-4624-9096-45b89fbfd4ae"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Answer vulnerable to Race Condition"
}
No mitigation information available for this CWE.
No CAPEC attack patterns related to this CWE.