-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix AFL++ fuzzing harness input handling & add security workflows #3556
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
base: v3/master
Are you sure you want to change the base?
Changes from all commits
1a7cfc7
e75ce02
7828476
cc04f2f
96b8e34
3f1cf6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: CodeQL Security | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "0 3 * * 1" | ||
|
|
||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
| actions: read | ||
|
|
||
| jobs: | ||
| codeql: | ||
| name: CodeQL C/C++ | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - name: Detect latest Lua dev package | ||
| id: detect_lua | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| sudo apt-get update -y -qq | ||
| CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)" | ||
|
|
||
| if [ -z "$CANDIDATES" ]; then | ||
| echo "No libluaX.Y-dev package found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| BEST_PKG="$( | ||
| printf '%s\n' "$CANDIDATES" \ | ||
| | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \ | ||
| | sort -V \ | ||
| | tail -n1 \ | ||
| | awk '{print $2}' | ||
| )" | ||
|
|
||
| echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get install -y \ | ||
| autoconf \ | ||
| automake \ | ||
| build-essential \ | ||
| libtool \ | ||
| pkg-config \ | ||
| libyajl-dev \ | ||
| libcurl4-openssl-dev \ | ||
| liblmdb-dev \ | ||
| ${{ steps.detect_lua.outputs.lua_pkg }} \ | ||
| libmaxminddb-dev \ | ||
| libpcre2-dev \ | ||
| libxml2-dev \ | ||
| libfuzzy-dev \ | ||
| pcre2-utils \ | ||
| libpcre3-dev \ | ||
| bison \ | ||
| flex \ | ||
| python3 \ | ||
| python3-venv | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v4 | ||
| with: | ||
| languages: c-cpp | ||
| queries: security-extended,security-and-quality | ||
|
|
||
| - name: Build for CodeQL database | ||
| run: | | ||
| ./build.sh | ||
| ./configure --enable-assertions=yes | ||
| make -j"$(nproc)" | ||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@v4 |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,146 @@ | ||||||||||||||
| name: Fuzzing Smoke Test | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
| inputs: | ||||||||||||||
| run_minutes: | ||||||||||||||
| description: "How many minutes AFL++ should fuzz" | ||||||||||||||
| required: false | ||||||||||||||
| default: "10" | ||||||||||||||
| fail_on_hangs: | ||||||||||||||
| description: "Fail workflow when AFL++ reports hangs" | ||||||||||||||
| required: false | ||||||||||||||
| default: "false" | ||||||||||||||
| type: choice | ||||||||||||||
| options: | ||||||||||||||
| - "false" | ||||||||||||||
| - "true" | ||||||||||||||
| schedule: | ||||||||||||||
| - cron: "0 2 * * 0" | ||||||||||||||
|
|
||||||||||||||
| permissions: | ||||||||||||||
| contents: read | ||||||||||||||
|
|
||||||||||||||
| concurrency: | ||||||||||||||
| group: fuzzing-smoke-${{ github.ref }} | ||||||||||||||
| cancel-in-progress: false | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| fuzzing-smoke: | ||||||||||||||
| name: AFL++ fuzzing smoke test | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| timeout-minutes: 60 | ||||||||||||||
|
|
||||||||||||||
| env: | ||||||||||||||
| AFL_SKIP_CPUFREQ: "1" | ||||||||||||||
| AFL_NO_AFFINITY: "1" | ||||||||||||||
| AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: "1" | ||||||||||||||
| AFL_NO_UI: "1" | ||||||||||||||
| AFL_FAST_CAL: "1" | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout repository | ||||||||||||||
| uses: actions/checkout@v6 | ||||||||||||||
| with: | ||||||||||||||
| fetch-depth: 0 | ||||||||||||||
| submodules: recursive | ||||||||||||||
|
|
||||||||||||||
| - name: Detect latest Lua packages | ||||||||||||||
| id: detect_lua | ||||||||||||||
| shell: bash | ||||||||||||||
| run: | | ||||||||||||||
| set -euo pipefail | ||||||||||||||
|
|
||||||||||||||
| sudo apt-get update -y -qq | ||||||||||||||
|
|
||||||||||||||
| CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)" | ||||||||||||||
|
|
||||||||||||||
| if [ -z "$CANDIDATES" ]; then | ||||||||||||||
| echo "No libluaX.Y-dev package found" | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| BEST_PKG="$( | ||||||||||||||
| printf '%s\n' "$CANDIDATES" \ | ||||||||||||||
| | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \ | ||||||||||||||
| | sort -V \ | ||||||||||||||
| | tail -n1 \ | ||||||||||||||
| | awk '{print $2}' | ||||||||||||||
| )" | ||||||||||||||
|
|
||||||||||||||
| BEST_VER="$(printf '%s\n' "$BEST_PKG" | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1/')" | ||||||||||||||
| LUA_PKG="lua$BEST_VER" | ||||||||||||||
|
|
||||||||||||||
| echo "lua_dev_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT" | ||||||||||||||
| echo "lua_pkg=$LUA_PKG" >> "$GITHUB_OUTPUT" | ||||||||||||||
|
|
||||||||||||||
| - name: Install dependencies | ||||||||||||||
| run: | | ||||||||||||||
| sudo apt-get install -y \ | ||||||||||||||
| autoconf automake build-essential afl++ clang libtool pkg-config \ | ||||||||||||||
| libyajl-dev libcurl4-openssl-dev liblmdb-dev \ | ||||||||||||||
| ${{ steps.detect_lua.outputs.lua_dev_pkg }} \ | ||||||||||||||
| ${{ steps.detect_lua.outputs.lua_pkg }} \ | ||||||||||||||
| libmaxminddb-dev libpcre2-dev libxml2-dev libfuzzy-dev \ | ||||||||||||||
| pcre2-utils libpcre3-dev bison flex python3 python3-venv | ||||||||||||||
|
|
||||||||||||||
| - name: Build ModSecurity with AFL++ | ||||||||||||||
| env: | ||||||||||||||
| CC: afl-clang-fast | ||||||||||||||
| CXX: afl-clang-fast++ | ||||||||||||||
| run: | | ||||||||||||||
| ./build.sh | ||||||||||||||
| ./configure --enable-afl-fuzz --enable-parser-generation --enable-assertions=yes | ||||||||||||||
| make -j"$(nproc)" | ||||||||||||||
|
|
||||||||||||||
| - name: Locate AFL target | ||||||||||||||
| id: target | ||||||||||||||
| run: | | ||||||||||||||
| for f in ./test/fuzzer/afl_fuzzer ./test/fuzzer/.libs/afl_fuzzer; do | ||||||||||||||
| [ -x "$f" ] && echo "target=$f" >> $GITHUB_OUTPUT && exit 0 | ||||||||||||||
| done | ||||||||||||||
| echo "Fuzzer not found" && exit 1 | ||||||||||||||
|
|
||||||||||||||
| - name: Create seed corpus | ||||||||||||||
| run: | | ||||||||||||||
| rm -rf fuzz-in fuzz-out | ||||||||||||||
| mkdir -p fuzz-in fuzz-out | ||||||||||||||
| printf '' > fuzz-in/empty | ||||||||||||||
| printf 'abc' > fuzz-in/plain | ||||||||||||||
|
|
||||||||||||||
| - name: Dry-run | ||||||||||||||
| run: timeout 10s "${{ steps.target.outputs.target }}" < fuzz-in/plain | ||||||||||||||
|
|
||||||||||||||
| - name: Run AFL++ | ||||||||||||||
| run: | | ||||||||||||||
| timeout "${{ github.event.inputs.run_minutes || '10' }}m" \ | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: sed -n '1,180p' .github/workflows/fuzzing-smoke.ymlRepository: owasp-modsecurity/ModSecurity Length of output: 4418 🌐 Web query:
💡 Result: <search_synthesis> <source_evidence> Citations:
Injection Reachability: External Validate
Manual dispatch requires repository write access, so this does not create a lower-privilege execution boundary. Move the expression into an environment variable and reject values other than decimal minutes before calling 🧰 Tools🪛 zizmor (1.30.0)[error] 116-116: code injection via template expansion (template-injection): may expand into attacker-controllable code (template-injection) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||
| afl-fuzz -i fuzz-in -o fuzz-out -m none -t 1000+ \ | ||||||||||||||
| -- "${{ steps.target.outputs.target }}" || true | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '100,146p' .github/workflows/fuzzing-smoke.yml
rg -n 'defaults:|shell:' .github/workflows/fuzzing-smoke.ymlRepository: owasp-modsecurity/ModSecurity Length of output: 1735 🏁 Script executed: sed -n '1,75p' .github/workflows/fuzzing-smoke.yml
sed -n '108,126p' .github/workflows/fuzzing-smoke.ymlRepository: owasp-modsecurity/ModSecurity Length of output: 2695 Do not suppress AFL++ startup failures.
The default GitHub Actions Bash shell enables Proposed fix- -- "${{ steps.target.outputs.target }}" || true
+ -- "${{ steps.target.outputs.target }}" || status=$?
+ status=${status:-0}
+ if [ "$status" -ne 0 ] && [ "$status" -ne 124 ]; then
+ exit "$status"
+ fi📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.30.0)[info] 118-118: code injection via template expansion (template-injection): may expand into attacker-controllable code (template-injection) 🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| - name: Summarize | ||||||||||||||
| id: summary | ||||||||||||||
| run: | | ||||||||||||||
| CRASH=$(find fuzz-out -path '*/crashes/id:*' -type f | wc -l) | ||||||||||||||
| HANG=$(find fuzz-out -path '*/hangs/id:*' -type f | wc -l) | ||||||||||||||
| echo "crash_count=$CRASH" >> $GITHUB_OUTPUT | ||||||||||||||
| echo "hang_count=$HANG" >> $GITHUB_OUTPUT | ||||||||||||||
|
|
||||||||||||||
| - name: Package results | ||||||||||||||
| if: always() | ||||||||||||||
| run: | | ||||||||||||||
| tar -czf afl-fuzz-results.tar.gz fuzz-in fuzz-out | ||||||||||||||
|
|
||||||||||||||
| - name: Upload results | ||||||||||||||
| if: always() | ||||||||||||||
| uses: actions/upload-artifact@v7 | ||||||||||||||
| with: | ||||||||||||||
| name: afl-fuzz-results-${{ github.run_id }} | ||||||||||||||
| path: afl-fuzz-results.tar.gz | ||||||||||||||
|
|
||||||||||||||
| - name: Fail on crashes | ||||||||||||||
| if: steps.summary.outputs.crash_count != '0' | ||||||||||||||
| run: exit 1 | ||||||||||||||
|
|
||||||||||||||
| - name: Fail on hangs | ||||||||||||||
| if: github.event.inputs.fail_on_hangs == 'true' && steps.summary.outputs.hang_count != '0' | ||||||||||||||
| run: exit 1 | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,152 @@ | ||||||||||||||||||
| name: Runtime Sanitizers | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| push: | ||||||||||||||||||
| pull_request: | ||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||
| schedule: | ||||||||||||||||||
| - cron: "0 4 * * 1" | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
file=".github/workflows/runtime-sanitizers.yml"
sed -n '1,220p' "$file"Repository: owasp-modsecurity/ModSecurity Length of output: 4208 Security Misconfiguration Reachability: External Declare least-privilege workflow permissions. This workflow executes checked-out code in both jobs. Without an explicit Proposed permissions+permissions:
+ contents: read
+
jobs:📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.30.0)[warning] 1-153: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 🤖 Prompt for AI AgentsSources: Learnings, Linters/SAST tools |
||||||||||||||||||
| asan-ubsan-linux: | ||||||||||||||||||
| name: ASan/UBSan Linux | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
|
|
||||||||||||||||||
| steps: | ||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||
| with: | ||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||
| submodules: recursive | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Detect latest Lua dev package | ||||||||||||||||||
| id: detect_lua | ||||||||||||||||||
| shell: bash | ||||||||||||||||||
| run: | | ||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||
| sudo apt-get update -y -qq | ||||||||||||||||||
| CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ -z "$CANDIDATES" ]; then | ||||||||||||||||||
| echo "No libluaX.Y-dev package found" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| BEST_PKG="$( | ||||||||||||||||||
| printf '%s\n' "$CANDIDATES" \ | ||||||||||||||||||
| | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \ | ||||||||||||||||||
| | sort -V \ | ||||||||||||||||||
| | tail -n1 \ | ||||||||||||||||||
| | awk '{print $2}' | ||||||||||||||||||
| )" | ||||||||||||||||||
|
|
||||||||||||||||||
| echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||
| run: | | ||||||||||||||||||
| sudo apt-get install -y \ | ||||||||||||||||||
| autoconf \ | ||||||||||||||||||
| automake \ | ||||||||||||||||||
| build-essential \ | ||||||||||||||||||
| clang \ | ||||||||||||||||||
| libtool \ | ||||||||||||||||||
| pkg-config \ | ||||||||||||||||||
| libyajl-dev \ | ||||||||||||||||||
| libcurl4-openssl-dev \ | ||||||||||||||||||
| liblmdb-dev \ | ||||||||||||||||||
| ${{ steps.detect_lua.outputs.lua_pkg }} \ | ||||||||||||||||||
| libmaxminddb-dev \ | ||||||||||||||||||
| libpcre2-dev \ | ||||||||||||||||||
| libxml2-dev \ | ||||||||||||||||||
| libfuzzy-dev \ | ||||||||||||||||||
| pcre2-utils \ | ||||||||||||||||||
| libpcre3-dev \ | ||||||||||||||||||
| bison \ | ||||||||||||||||||
| flex \ | ||||||||||||||||||
| python3 \ | ||||||||||||||||||
| python3-venv | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build with AddressSanitizer and UndefinedBehaviorSanitizer | ||||||||||||||||||
| env: | ||||||||||||||||||
| CC: clang | ||||||||||||||||||
| CXX: clang++ | ||||||||||||||||||
| CFLAGS: "-fsanitize=address,undefined -fno-omit-frame-pointer -O1" | ||||||||||||||||||
| CXXFLAGS: "-fsanitize=address,undefined -fno-omit-frame-pointer -O1" | ||||||||||||||||||
| LDFLAGS: "-fsanitize=address,undefined" | ||||||||||||||||||
| ASAN_OPTIONS: "detect_leaks=1:abort_on_error=1:strict_string_checks=1" | ||||||||||||||||||
| UBSAN_OPTIONS: "halt_on_error=1:print_stacktrace=1" | ||||||||||||||||||
| run: | | ||||||||||||||||||
| ./build.sh | ||||||||||||||||||
| ./configure --enable-assertions=yes | ||||||||||||||||||
| make -j"$(nproc)" | ||||||||||||||||||
| timeout 30m make check | ||||||||||||||||||
|
|
||||||||||||||||||
| valgrind-linux: | ||||||||||||||||||
| name: Valgrind Linux | ||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||
|
|
||||||||||||||||||
| steps: | ||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||
| with: | ||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||
| submodules: recursive | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Detect latest Lua dev package | ||||||||||||||||||
| id: detect_lua | ||||||||||||||||||
| shell: bash | ||||||||||||||||||
| run: | | ||||||||||||||||||
| set -euo pipefail | ||||||||||||||||||
| sudo apt-get update -y -qq | ||||||||||||||||||
| CANDIDATES="$(apt-cache pkgnames | grep -E '^liblua[0-9]+\.[0-9]+-dev$' || true)" | ||||||||||||||||||
|
|
||||||||||||||||||
| if [ -z "$CANDIDATES" ]; then | ||||||||||||||||||
| echo "No libluaX.Y-dev package found" | ||||||||||||||||||
| exit 1 | ||||||||||||||||||
| fi | ||||||||||||||||||
|
|
||||||||||||||||||
| BEST_PKG="$( | ||||||||||||||||||
| printf '%s\n' "$CANDIDATES" \ | ||||||||||||||||||
| | sed -E 's/^liblua([0-9]+\.[0-9]+)-dev$/\1 &/' \ | ||||||||||||||||||
| | sort -V \ | ||||||||||||||||||
| | tail -n1 \ | ||||||||||||||||||
| | awk '{print $2}' | ||||||||||||||||||
| )" | ||||||||||||||||||
|
|
||||||||||||||||||
| echo "lua_pkg=$BEST_PKG" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||
| run: | | ||||||||||||||||||
| sudo apt-get install -y \ | ||||||||||||||||||
| autoconf \ | ||||||||||||||||||
| automake \ | ||||||||||||||||||
| build-essential \ | ||||||||||||||||||
| valgrind \ | ||||||||||||||||||
| libtool \ | ||||||||||||||||||
| pkg-config \ | ||||||||||||||||||
| libyajl-dev \ | ||||||||||||||||||
| libcurl4-openssl-dev \ | ||||||||||||||||||
| liblmdb-dev \ | ||||||||||||||||||
| ${{ steps.detect_lua.outputs.lua_pkg }} \ | ||||||||||||||||||
| libmaxminddb-dev \ | ||||||||||||||||||
| libpcre2-dev \ | ||||||||||||||||||
| libxml2-dev \ | ||||||||||||||||||
| libfuzzy-dev \ | ||||||||||||||||||
| pcre2-utils \ | ||||||||||||||||||
| libpcre3-dev \ | ||||||||||||||||||
| bison \ | ||||||||||||||||||
| flex \ | ||||||||||||||||||
| python3 \ | ||||||||||||||||||
| python3-venv | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build | ||||||||||||||||||
| run: | | ||||||||||||||||||
| ./build.sh | ||||||||||||||||||
| ./configure --enable-assertions=yes | ||||||||||||||||||
| make -j"$(nproc)" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Run tests under Valgrind | ||||||||||||||||||
| run: | | ||||||||||||||||||
| timeout 45m valgrind \ | ||||||||||||||||||
| --error-exitcode=1 \ | ||||||||||||||||||
| --leak-check=full \ | ||||||||||||||||||
| --show-leak-kinds=definite,indirect \ | ||||||||||||||||||
| make check | ||||||||||||||||||
|
Comment on lines
+148
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Run Valgrind on each test executable. This command instruments Use the Proposed fix- timeout 45m valgrind \
- --error-exitcode=1 \
- --leak-check=full \
- --show-leak-kinds=definite,indirect \
- make check
+ timeout 45m env \
+ VALGRIND="valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=definite,indirect" \
+ make check📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.30.0)[warning] 1-153: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 83-153: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 🤖 Prompt for AI Agents |
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: owasp-modsecurity/ModSecurity
Length of output: 4481
🌐 Web query:
actions checkout v6 persist-credentials default token storage runner temp documentation💡 Result:
<search_synthesis>
In actions/checkout v6, the persist-credentials input defaults to true [1][2]. This setting controls whether the repository checkout action configures the provided token or SSH key within the local Git configuration to enable subsequent authenticated Git commands [3][4]. Regarding storage, actions/checkout v6 has improved security by no longer storing credentials directly in the.git/config file [3][5]. Instead, it creates a temporary directory under the runner&
#39;s $RUNNER_TEMP environment variable and stores the credentials within that location [3][6]. The action manages this by temporarily overriding the HOME environment variable to point to this temporary directory, ensuring Git uses the isolated configuration [6][7]. The token or credential is removed during the post-job cleanup process [3][4]. Because this method relies on the $RUNNER_TEMP location, workflows that execute Git commands inside Docker containers (or other isolated environments) may encounter issues if the container does not have access to the $RUNNER_TEMP directory [8]. To resolve this, the $RUNNER_TEMP path must often be explicitly mounted into the container [8].</search_synthesis>
<source_evidence>
Citations:
🏁 Script executed:
Repository: owasp-modsecurity/ModSecurity
Length of output: 4522
Sensitive Data Exposure
Reachability: Internal
Exploitability: Difficult
CWE: CWE-522 — Insufficiently Protected Credentials
Disable persisted checkout credentials.
actions/checkout@v6persists${{ github.token }}for authenticated Git commands by default. This workflow executes checked-out build and fuzzer code and compiles recursively checked-out submodules. Compromised code could use the credential to make authenticated read requests or exfiltrate it during the job.contents: readlimits the token but does not remove this access. No later step requires authenticated Git operations.uses: actions/checkout@v6 with: + persist-credentials: false fetch-depth: 0 submodules: recursive📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.30.0)
[warning] 42-46: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents