Common Weakness Enumeration

CWE-365

Weakness Prohibited

DEPRECATED: 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
Submission: CLASP · 2006-07-19 · CWE Draft 3
Contribution: Yongchool Ryu, MathWorks; Roberto Bagnara, BUGSENG; Guido Persch, Imagix; John Blattner, Imagix; Paul Anderson, GrammaTech; Fulvio Baccaglini; John Viega; Robert Seacord; Members of the CWE-Research mailing list, including Jonathan Hood and Steve Grubb; Commenters on Twitter, including Patricia Aas, Myria, Richard Barrell, and others · 2022-03-31 · CWE 4.7

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.

Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2008-11-24 · CWE 1.1

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2010-09-27 · CWE 1.10

updated Relationships

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2011-06-27 · CWE 2.0

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Demonstrative_Examples, References, Relationships

Modification: CWE Content Team · MITRE · 2014-06-23 · CWE 2.7

updated Common_Consequences, Description, Other_Notes, Potential_Mitigations

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Demonstrative_Examples

Modification: CWE Content Team · MITRE · 2019-01-03 · CWE 3.2

updated Relationships, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Description, References, Relationships

Modification: CWE Content Team · MITRE · 2022-04-28 · CWE 4.7

updated Applicable_Platforms, Common_Consequences, Demonstrative_Examples, Description, Likelihood_of_Exploit, Name, Potential_Mitigations, References, Relationships, Taxonomy_Mappings, Time_of_Introduction, Type

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

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:53
VLAI
Summary
Answer vulnerable to Race Condition
Details

Race Condition in Switch in GitHub repository answerdev/answer prior to 1.0.4.

Show details on source website

{
  "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.