Skip to content

check code template signature before dast load - #7472

Merged
ehsandeep merged 1 commit into
devfrom
dast-code-load
Jun 19, 2026
Merged

ehsandeep merged 1 commit into
devfrom
dast-code-load

Conversation

@dogancanbakir

@dogancanbakir dogancanbakir commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Hoists the unsigned code-template guard ahead of the dast branch so it applies on every load path.

Fixes #7470

Summary by CodeRabbit

  • New Features

    • Unsigned Code protocol templates are now prevented from being loaded and executed regardless of execution mode.
  • Tests

    • Added test coverage for unsigned template handling scenarios.

Hoist the unsigned code-template guard ahead of the dast branch so it applies on every load path.
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4259915-4ba4-4ad0-bd2f-115d10ff903f

📥 Commits

Reviewing files that changed from the base of the PR and between c041bf2 and 86bc90b.

⛔ Files ignored due to path filters (1)
  • internal/tests/integration/testdata/protocols/code/dast-unsigned.yaml is excluded by !**/*.yaml
📒 Files selected for processing (2)
  • internal/tests/integration/code_test.go
  • pkg/catalog/loader/loader.go

Walkthrough

An early unconditional guard is added in LoadTemplatesWithTags to reject unsigned/unverified Code-protocol templates before the DAST loading branch, closing the bypass. The previously later-stage conditional performing the same check is removed. An integration test case is added to verify that unsigned templates are rejected when nuclei runs with -dast.

Changes

Unsigned Code Template DAST Gate

Layer / File(s) Summary
Early unsigned Code template guard in loader
pkg/catalog/loader/loader.go
Adds an early filter at line ~900 that detects unverified Code-protocol templates (non-workflow), increments tampered and unsigned skip counters, optionally logs a warning, and returns without loading. Removes the now-redundant later conditional at line ~941 that previously handled the same case but only after the DAST branch.
Integration test: unsigned Code rejected under -dast
internal/tests/integration/code_test.go
Adds protocols/code/dast-unsigned.yaml to the codeTestCases table with isCodeDisabled gating, skips it in ensureSignedCodeTemplates, and implements dastUnsignedCode.Execute to run nuclei with -dast, treating execution error as the expected pass and failing if the unsigned template executes without error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • Mzack9999

Poem

🐇 A sneaky template tried to slip right through,
With a -dast disguise, unsigned and new.
But the loader's guard now checks the gate,
Unsigned code must wait — that's just its fate!
The rabbit stamps the diff: "Patch approved, hooray!" 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: enforcing code template signature checks before DAST loading, which is the core security fix.
Linked Issues check ✅ Passed The PR directly addresses issue #7470 by moving the unsigned code-template validation guard to an earlier execution point, ensuring signature validation applies to all template load paths including DAST.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the security issue: adding a test case for unsigned DAST templates, updating signing list generation to exclude it, and moving the validation guard earlier in the loader.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dast-code-load

Comment @coderabbitai help to get the list of available commands and usage tips.

@ehsandeep
ehsandeep merged commit 1c440e7 into dev Jun 19, 2026
19 checks passed
@ehsandeep
ehsandeep deleted the dast-code-load branch June 19, 2026 14:55
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
nuclei 3.10.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed

### 🎉 New Features
* Added per-host HTTP client pooling by @Mzack9999 in projectdiscovery/nuclei#7301

### 🐞 Bug Fixes
* Fixed handling in hosterrorscache to automatically skip hosts that consistently time out by @knakul853 in projectdiscovery/nuclei#7455
* Fixed preservation of explicit target port in network templates (fixes #7323) by @XananasX7 in projectdiscovery/nuclei#7465
* Fixed connection reuse and improved port pre-flight handling by @Mzack9999 in projectdiscovery/nuclei#6715
* Fixed code template signature validation before DAST loading by @dogancanbakir in projectdiscovery/nuclei#7472
* Fixed gating of MySQL allowAllFiles option to require `-lfa` flag by @dogancanbakir in projectdiscovery/nuclei#7473
* Fixed ASCII-section regex to properly escape literal `.` by @snicket2100 in projectdiscovery/nuclei#7476
* Fixed recording of decoded bytes for debug dumps by @snicket2100 in projectdiscovery/nuclei#7478
* Fixed proper escaping of dbname in lib/pq URLs by @dwisiswant0 in projectdiscovery/nuclei#7479
* Fixed network policy enforcement prior to LDAP dialing by @dwisiswant0 in projectdiscovery/nuclei#7494
* Fixed normalization and rejection of trace file DSN options in Oracle by @dwisiswant0 in projectdiscovery/nuclei#7480
* Fixed proper escaping of MSSQL database names in connection URLs by @dwisiswant0 in projectdiscovery/nuclei#7481
* Fixed krbforge to reject unsandboxed ccache writes by @dwisiswant0 in projectdiscovery/nuclei#7482
* Fixed rejection of request-condition(s) during fuzzing by @dwisiswant0 in projectdiscovery/nuclei#7466
* Fixed: YAML now correctly rejects recursive include chains by @dwisiswant0 in projectdiscovery/nuclei#7492
* Fixed resource leaks by @Mzack9999 in projectdiscovery/nuclei#7502

### Other Changes
* Updated govaluate dependency to prevent slice-bounds panic on invalid UTF-8 input by @XananasX7 in projectdiscovery/nuclei#7464
* Updated goja dependency by @Mzack9999 in projectdiscovery/nuclei#7467
* Updated dependencies to remove unused packages by @dwisiswant0 in projectdiscovery/nuclei#7457
* Refactored templates to centralize opt-in capability gating by @dwisiswant0 in projectdiscovery/nuclei#7489
* Added fuzzing parser harnesses for raw requests and templates by @dwisiswant0 in projectdiscovery/nuclei#7459
* Refactored template rendering boundary by @dwisiswant0 in projectdiscovery/nuclei#7499

## New Contributors
* @XananasX7 made their first contribution in projectdiscovery/nuclei#7465
* @snicket2100 made their first contribution in projectdiscovery/nuclei#7476

**Full Changelog**: https://github.com/projectdiscovery/nuclei/compare/v3.9.0...v3.10.0</pre>
  <p>View the full release notes at <a href="https://github.com/projectdiscovery/nuclei/releases/tag/v3.10.0">https://github.com/projectdiscovery/nuclei/releases/tag/v3.10.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!13187
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.

Unsigned code templates load under -dast

3 participants