Skip to content

chore(deps): bump govaluate to fix slice-bounds panic on invalid UTF-8 input - #7464

Merged
dwisiswant0 merged 1 commit into
projectdiscovery:devfrom
XananasX7:fix/govaluate-invalid-utf8-bump
Jun 17, 2026
Merged

chore(deps): bump govaluate to fix slice-bounds panic on invalid UTF-8 input#7464
dwisiswant0 merged 1 commit into
projectdiscovery:devfrom
XananasX7:fix/govaluate-invalid-utf8-bump

Conversation

@XananasX7

@XananasX7 XananasX7 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Bump github.com/projectdiscovery/govaluate to v0.0.0-20260615100919-5ee2581bbf7e to pull in the fix for the slice-bounds panic on invalid UTF-8 input.

Related Issue

Fixes #7462

Root Cause

The govaluate lexer advanced strPosition by utf8.RuneLen(utf8.RuneError) == 3 when it encountered an invalid UTF-8 byte, even though only 1 byte was consumed. This caused the offset to drift past the actual string length, triggering a slice bounds out of range panic in readUntilFalse.

Since expressions.Evaluate only caught govaluate errors (not panics), a target returning invalid UTF-8 bytes in response data could crash the entire nuclei process.

Fix

The upstream fix was merged in projectdiscovery/govaluate#4 (today, 2026-06-15). This PR updates nuclei's dependency to consume it.

Changes:

  • go.mod: bump govaluate v0.0.0-20260504230327-80320480bb6ev0.0.0-20260615100919-5ee2581bbf7e
  • go.sum: updated checksums

Testing

  • go build ./... passes cleanly
  • Existing unit tests pass
  • The crash path (invalid UTF-8 in evaluated expressions) is now handled gracefully at the govaluate lexer level

Summary by CodeRabbit

  • Chores
    • Updated govaluate dependency to the latest version.

Upgrade github.com/projectdiscovery/govaluate from
v0.0.0-20260504230327-80320480bb6e to
v0.0.0-20260615100919-5ee2581bbf7e to consume the fix merged in
projectdiscovery/govaluate#4.

The govaluate lexer advanced strPosition by utf8.RuneLen(utf8.RuneError)
== 3 for invalid bytes, even though only 1 byte was consumed. This
caused byte-offset drift past the actual string length and a
`slice bounds out of range` panic in readUntilFalse.

Nuclei's expressions.Evaluate only caught govaluate errors, not panics,
so targets returning invalid UTF-8 in response data could crash the
entire process.

Fixes projectdiscovery#7462
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updates the github.com/projectdiscovery/govaluate dependency in go.mod from pseudo-version v0.0.0-20260504230327-80320480bb6e to v0.0.0-20260615100919-5ee2581bbf7e. No other files are modified.

Changes

govaluate Dependency Bump

Layer / File(s) Summary
govaluate version bump
go.mod
Updates github.com/projectdiscovery/govaluate to a newer pseudo-version dated 2026-06-15.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

Poem

A module line, just one small edit,
The govaluate hop was worth it!
From May to June the hash has changed,
And panics past are rearranged.
🐇 hops away satisfied

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and specifically describes the main change: bumping the govaluate dependency to fix a critical slice-bounds panic issue caused by invalid UTF-8 input.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@dwisiswant0 dwisiswant0 changed the title fix: bump govaluate to fix slice-bounds panic on invalid UTF-8 input (fixes #7462) fix: bump govaluate to fix slice-bounds panic on invalid UTF-8 input Jun 16, 2026
@dwisiswant0 dwisiswant0 changed the title fix: bump govaluate to fix slice-bounds panic on invalid UTF-8 input chore(deps): bump govaluate to fix slice-bounds panic on invalid UTF-8 input Jun 17, 2026
@dwisiswant0
dwisiswant0 merged commit c0b1f4b into projectdiscovery:dev Jun 17, 2026
19 checks passed
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.

[BUG] govaluate: slice bounds out of range panic in readUntilFalse on invalid UTF-8 input

2 participants