ci: integrate typos spell checker into CI (#6532)#7080
ci: integrate typos spell checker into CI (#6532)#7080Yeachan-Heo wants to merge 1 commit intoprojectdiscovery:devfrom
Conversation
Add typos spell checker GitHub Actions workflow and configuration. Fix legitimate typos found across the codebase (comments, variable names, and an exported constant). Changes: - Add .github/workflows/typos.yml using crate-ci/typos action - Add _typos.toml config for false positives (foreign language READMEs, test data, variable names, WAF regexes, SQL injection patterns) - Fix typos: Reuests->Requests, fiter->filter, seperate->separate, formated->formatted, thant->that, ExludedDastTmplStats->ExcludedDastTmplStats Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Neo - PR Security ReviewMedium: 1 Highlights
Medium (1)
Security ImpactGitHub Action pinned to mutable branch reference ( Attack ExamplesGitHub Action pinned to mutable branch reference ( Suggested FixesGitHub Action pinned to mutable branch reference ( 🤖 Prompt for AI AgentsHardening Notes
Comment |
WalkthroughThis PR corrects multiple typos and misspellings across the codebase, including variable naming, constant identifiers, struct names, and comments. It also introduces a _typos.toml configuration file for the typos tool to prevent future typos. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: crate-ci/typos@master |
There was a problem hiding this comment.
🟡 GitHub Action pinned to mutable branch reference (CWE-829) — The crate-ci/typos action is referenced using @master, which is a mutable branch reference. This means the workflow will automatically use whatever code is on the master branch at runtime, potentially executing malicious code if the upstream repository is compromised.
Attack Example
Attacker compromises crate-ci/typos repository → pushes malicious code to master branch → next PR triggers this workflow → malicious code executes with workflow permissions → attacker can read repository contents, access GITHUB_TOKEN, or modify workflow artifacts
Suggested Fix
Pin the action to a specific commit SHA or immutable tag version. Replace 'uses: crate-ci/typos@master' with 'uses: crate-ci/typos@v1.28.3' (or latest stable version) or use a commit SHA like 'uses: crate-ci/typos@a1234567890abcdef1234567890abcdef12345678'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@.github/workflows/typos.yml` at line 20, the crate-ci/typos action is
referenced using the mutable @master branch reference; replace it with a pinned
version tag (e.g., @v1.28.3) or a specific commit SHA to prevent automatic
execution of potentially malicious code if the upstream repository is
compromised. Check the crate-ci/typos releases page for the latest stable
version.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@_typos.toml`:
- Around line 56-73: Update the suppressed-typos list to correct actual mistakes
and clarify intentional suppressions: change the entries for noticable ->
"noticeable", brower -> "browser", and inerval -> "interval"; remove or justify
the worflow entry if it no longer appears; and add a short clarifying comment
next to pannel noting that "pannel" is intentionally suppressed because it
matches a real-world target application typo (used in the integration test
matcher "{{BaseURL}}/admin-pannel"). Ensure the keys referenced (pannel,
noticable, brower, inerval, worflow) in the existing suppression block are
edited accordingly.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
.github/workflows/typos.ymlis excluded by!**/*.yml
📒 Files selected for processing (10)
_typos.tomlcmd/tmc/main.gointernal/runner/runner.gointernal/server/server.golib/config.golib/tests/sdk_test.gopkg/catalog/loader/loader.gopkg/templates/parser_stats.gopkg/templates/stats.gopkg/tmplexec/flow/flow_executor_test.go
| Nin = "Nin" | ||
| # "pannel" appears in integration test template matchers | ||
| pannel = "pannel" | ||
| # "noticable" in test template | ||
| noticable = "noticable" | ||
| # AllowdTypes is from the external goflags package | ||
| Allowd = "Allowd" | ||
| # Spanish test data in fuzz playground | ||
| algoritmos = "algoritmos" | ||
| # "brower" and "inerval" in Chinese README (excluded but also in code) | ||
| brower = "brower" | ||
| inerval = "inerval" | ||
| # "worflow" in README | ||
| worflow = "worflow" | ||
| # "ser" appears in foreign language and deserialization context | ||
| ser = "ser" | ||
| # IST is a timezone abbreviation in test data | ||
| IST = "IST" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Find occurrences of suppressed typos to determine if they should be fixed
echo "=== Searching for 'pannel' ==="
rg -n -C2 'pannel' --type-not=toml
echo -e "\n=== Searching for 'noticable' ==="
rg -n -C2 'noticable' --type-not=toml
echo -e "\n=== Searching for 'brower' ==="
rg -n -C2 'brower' --type-not=toml
echo -e "\n=== Searching for 'inerval' ==="
rg -n -C2 'inerval' --type-not=toml
echo -e "\n=== Searching for 'worflow' ==="
rg -n -C2 'worflow' --type-not=tomlRepository: projectdiscovery/nuclei
Length of output: 2065
Consider fixing genuine typos and clarifying intentional suppressions.
The suppressed typos have mixed justifications:
pannel(line 58) — appears in test matcher"{{BaseURL}}/admin-pannel"(integration_tests/protocols/http/matcher-status.yaml:17). Suppression is valid; this intentionally matches a typo in a real-world target application.noticable(line 60) — appears as a comment typo in integration_tests/protocols/network/net-https-timeout.yaml:15. Should be fixed to "noticeable".brower(line 66) — appears in documentation (README_CN.md:263) as-show-browerflag. Should be fixed to "browser".inerval(line 67) — appears in documentation (README_CN.md:297) as-stats-inervalflag. Should be fixed to "interval".worflow(line 69) — does not appear in the codebase; suppression can be removed or clarified.
Fix the typos in comments and documentation; clarify in the comment for pannel that it intentionally matches a real-world application typo.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@_typos.toml` around lines 56 - 73, Update the suppressed-typos list to
correct actual mistakes and clarify intentional suppressions: change the entries
for noticable -> "noticeable", brower -> "browser", and inerval -> "interval";
remove or justify the worflow entry if it no longer appears; and add a short
clarifying comment next to pannel noting that "pannel" is intentionally
suppressed because it matches a real-world target application typo (used in the
integration test matcher "{{BaseURL}}/admin-pannel"). Ensure the keys referenced
(pannel, noticable, brower, inerval, worflow) in the existing suppression block
are edited accordingly.
Summary
crate-ci/typosGitHub Actions workflow (.github/workflows/typos.yml) to catch spelling errors in PRs and pushes to dev_typos.tomlconfiguration to handle false positives: foreign language READMEs, test data, WAF regex patterns, SQL injection patterns, exported API identifiers, and encoded certificate dataReuests->Requests(comment in server.go)fiter->filter(comment in config.go)seperate->separate(comments in sdk_test.go)formated/Formated->formatted/Formatted(variables/strings in tmc/main.go)thant->that(comment in flow_executor_test.go)ExludedDastTmplStats->ExcludedDastTmplStats(exported constant in parser_stats.go, stats.go, runner.go, loader.go)Closes #6532
Test plan
typosruns clean with the provided_typos.tomlconfigExcludedDastTmplStats)🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Chores