Skip to content

examples: add review finding fixture - #4

Closed
idy wants to merge 1 commit into
mainfrom
codex/review-inline-finding
Closed

examples: add review finding fixture#4
idy wants to merge 1 commit into
mainfrom
codex/review-inline-finding

Conversation

@idy

@idy idy commented Jul 23, 2026

Copy link
Copy Markdown
Member

Purpose

Deliberately adds a small command-injection fixture to validate the reusable OpenAI PR-review workflow.

Expected review result

The reviewer should leave a native inline finding on the exec call because the untrusted revision value is interpolated into a shell command.

Validation

  • node --check examples/review-fixture.js
  • git diff --check

The review workflow needs a deterministic, line-addressable flaw to validate that
Codex reports actionable findings as native inline PR comments.

- add a minimal Node handler with unsanitized shell interpolation
- keep the fixture isolated from workflow implementation files
- make the vulnerable exec call the explicit inline-review target

Generated with [Codex](https://github.com/openai)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 OpenAI PR review

Reviewed commit: 9dbb821601

Model: gpt-5.6-terra

Reasoning effort: medium

The pull request introduces an unauthenticated command-injection vulnerability.

1 inline finding published.

export function showRevision(request, response) {
const revision = request.query.revision;

exec(`git show ${revision}`, (error, stdout) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Sanitize revision before passing it to the shell

revision comes directly from request.query and is interpolated into a shell command passed to exec. An attacker can supply shell metacharacters (for example, ?revision=HEAD%3B...) to execute arbitrary commands under the server process. Validate against a strict revision format and pass arguments via execFile/spawn without a shell.

Useful? React with 👍 / 👎.

@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Inline-review smoke validation completed successfully; closing the intentionally vulnerable test PR.

@idy idy closed this Jul 23, 2026
@idy idy reopened this Jul 23, 2026
@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 OpenAI PR review

Reviewed commit: 9dbb821601

Model: gpt-5.6-terra

Reasoning effort: medium

Found one command-injection vulnerability introduced by the pull request.

1 inline finding published.

export function showRevision(request, response) {
const revision = request.query.revision;

exec(`git show ${revision}`, (error, stdout) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Unsanitized revision is interpolated into a shell command

revision comes directly from request.query and is passed to exec, which invokes a shell. An attacker can supply shell metacharacters (for example, main; <command>) to execute arbitrary commands. Validate against an expected Git revision format and invoke Git without a shell (for example, execFile with argument arrays).

Useful? React with 👍 / 👎.

@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 OpenAI PR review

Reviewed commit: 9dbb821601

Model: gpt-5.6-terra

Reasoning effort: medium

The pull request introduces an unauthenticated shell-command injection path.

1 inline finding published.

export function showRevision(request, response) {
const revision = request.query.revision;

exec(`git show ${revision}`, (error, stdout) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid interpolating the request revision into a shell command

revision is request-controlled and is interpolated into exec, which invokes a shell. A value such as HEAD; <command> executes arbitrary commands on the server. Validate against a strict revision format and invoke git without a shell (for example, execFile with argument arrays).

Useful? React with 👍 / 👎.

@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codex review

@idy

idy commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Reclosing the smoke PR after reaction-lifecycle investigation. The failure evidence remains in Actions history.

@idy idy closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant