Visitar URL original
WIP : Swift: Add Command Injection query by maikypedia · Pull Request #13726 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20230714180758/https://github.com/github/codeql/pull/13726
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP : Swift: Add Command Injection query #13726

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

maikypedia
Copy link
Contributor

WIP

@maikypedia maikypedia requested a review from a team as a code owner July 12, 2023 00:16
@maikypedia maikypedia changed the title WIP : Swift: Ruby: Add Command Injection query WIP : Swift: Add Command Injection query Jul 12, 2023
Copy link
Contributor

@geoffw0 geoffw0 left a comment

Choose a reason for hiding this comment

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

Hi @maikypedia , this query looks great! You've marked it as a work-in-progress so I'll just make a few small comments for now. When you're ready we can either do a more detailed review (and add some tests) - or we can just merge your work it into an 'experimental' directory if you'd prefer us to take it from there.

<overview>
<p>
Constructing a system command with unsanitized user input is dangerous,
since a malicious user to execute code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
since a malicious user to execute code.
since a malicious user may be able to craft input that executes arbitrary code.

</p>
<sample src="CommandInjectionBad.swift" />
<p>
If user input is used to construct a regular expression it should be checked
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
If user input is used to construct a regular expression it should be checked
If user input is used to construct a command it should be checked

* @precision high
* @id swift/command-line-injection
* @tags security
* external/cwe/cwe-078
Copy link
Contributor

Choose a reason for hiding this comment

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

CWE-88 is also relevant.

Suggested change
* external/cwe/cwe-078
* external/cwe/cwe-078
* external/cwe/cwe-088

maikypedia and others added 2 commits July 12, 2023 16:44
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
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.

None yet

2 participants