Skip to content

C++/C#: Specify additional CWE tags for queries that specify CWE 114#22149

Merged
jketema merged 3 commits into
github:mainfrom
jketema:jketema/cwe-114-tag
Jul 9, 2026
Merged

C++/C#: Specify additional CWE tags for queries that specify CWE 114#22149
jketema merged 3 commits into
github:mainfrom
jketema:jketema/cwe-114-tag

Conversation

@jketema

@jketema jketema commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

This addresses #22131 for all queries that specify CWE 114. I kept the CWE 114 tag, as customers might depend on this.

See individual commit messages for further motivation.

Note that the changelog CI failure is incorrect (it errors on the removed change note).

jketema added 3 commits July 9, 2026 17:09
After almost 4 years it does not seem to be relevant anymore to propagate this
to the change log.
Use of CWE-114 is discoraged, and CWE-73 seems appropriate as the assembly
path is user controlled here.
User controlled data here either leads to the loading of an uncontrolled
library (CWE 73) or the execution of an uncontrolled command (CWE 78).
Copilot AI review requested due to automatic review settings July 9, 2026 15:15
@jketema jketema requested review from a team as code owners July 9, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates query metadata for the C++ and C# CWE-114 queries to include additional CWE tags (per issue #22131’s concern about CWE-114’s “discouraged” mapping), and records the metadata change in change notes.

Changes:

  • Add external/cwe/cwe-073 to the C# cs/assembly-path-injection query metadata.
  • Add external/cwe/cwe-073 and external/cwe/cwe-078 to the C++ cpp/uncontrolled-process-operation query metadata.
  • Add new query-metadata change-note entries for both languages (and delete an older C# released change-note file).
Show a summary per file
File Description
csharp/ql/src/Security Features/CWE-114/AssemblyPathInjection.ql Adds an additional CWE tag (cwe-073) to the query metadata header.
cpp/ql/src/Security/CWE/CWE-114/UncontrolledProcessOperation.ql Adds additional CWE tags (cwe-073, cwe-078) to the query metadata header.
csharp/ql/src/change-notes/2026-07-09-CWE-114.md Adds a change note for the C# query metadata update.
cpp/ql/src/change-notes/2026-07-09-CWE-114.md Adds a change note for the C++ query metadata update.
csharp/ql/src/change-notes/released/2022-11-07-constant-expression.md Deletes an older released change-note entry unrelated to CWE-114 metadata.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread csharp/ql/src/change-notes/2026-07-09-CWE-114.md

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thx!

@geoffw0 geoffw0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Thanks for fixing this!

@jketema jketema merged commit 161c8c4 into github:main Jul 9, 2026
31 of 32 checks passed
@jketema jketema deleted the jketema/cwe-114-tag branch July 9, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants