Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
if: github.event_name == 'pull_request_target'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish the validated title to the run summary
if: github.event_name == 'pull_request_target'
run: |
echo "### Validated PR title" >> "$GITHUB_STEP_SUMMARY"
echo "${{ github.event.pull_request.title }}" >> "$GITHUB_STEP_SUMMARY"
echo "by ${{ github.event.pull_request.user.login }}" >> "$GITHUB_STEP_SUMMARY"
Comment on lines +41 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- workflow excerpt ---'
sed -n '1,90p' .github/workflows/lint-pr.yml
printf '%s\n' '--- relevant workflow references ---'
rg -n -C 3 'pull_request_target|pull_request.title|pull_request.user.login|GITHUB_STEP_SUMMARY|Validated PR title' .github/workflows/lint-pr.yml
printf '%s\n' '--- shell interpolation probe ---'
python3 - <<'PY'
import subprocess
title = 'ok $(printf INJECTED >&2)'
script = f'echo "{title}"'
result = subprocess.run(
    ['/bin/sh', '-c', script],
    text=True,
    capture_output=True,
    check=False,
)
print('script:', script)
print('stdout:', result.stdout.rstrip())
print('stderr:', result.stderr.rstrip())
print('returncode:', result.returncode)
PY

Repository: sshiv012/texera

Length of output: 3137


Injection (CWE-78): Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Reachability: External

Prevent shell injection from the pull request title.

github.event.pull_request.title is expanded into the shell script. A title containing $(...) can execute commands in the pull_request_target runner. Pass the title and login through env: and print quoted environment variables with printf.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 41-41: "github.event.pull_request.title" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

🪛 zizmor (1.29.0)

[error] 43-43: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 44-44: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/lint-pr.yml around lines 41 - 44, Update the workflow step
that writes the PR validation summary to pass the pull request title and user
login through the step’s env configuration instead of interpolating them into
the shell script. Use printf with quoted environment variables when writing both
values, preserving the existing summary content while preventing command
substitution from user-controlled titles.

Source: Linters/SAST tools

- name: Skip PR title validation for merge group
if: github.event_name == 'merge_group'
run: echo "PR title validation is handled before pull requests enter the merge queue."