Skip to content

fix(appsec): don't double-count URL query args - #4808

Closed
bharathvemula wants to merge 1 commit into
crowdsecurity:masterfrom
bharathvemula:fix-appsec-double-count-args
Closed

bharathvemula wants to merge 1 commit into
crowdsecurity:masterfrom
bharathvemula:fix-appsec-double-count-args

Conversation

@bharathvemula

Copy link
Copy Markdown

Fixes #4311

processRequest() fed request.Args into the transaction with AddGetRequestArgument and then called ProcessURI, which extracts the same query arguments from the URI again — every query parameter was counted twice (e.g. &ARGS_GET:foo @eq 1 never matched a single ?foo=x). The loop is now gated: only arguments ProcessURI will not add reach the transaction, so query args count once while args supplied outside the URI still reach the rules. Wholesale deletion was not possible: the test suite builds requests with Args outside the URI, and deleting the loop broke 10 test functions.

Tested: new TestAppsecQueryArgsNotDoubleCounted (fails before, passes after); go test ./pkg/acquisition/modules/appsec/... and ./pkg/appsec/... pass; go vet clean; golangci-lint run ./pkg/acquisition/modules/appsec/... (v2.13.0) clean. Full make test not run.

Note: #4311 still carries needs/triage; the reporter verified commenting out the loop makes the count correct.

Testing above was run by an AI agent; no human has independently verified it yet.

Disclosure: this PR was prepared with AI assistance.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

@bharathvemula: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.

  • /kind feature
  • /kind enhancement
  • /kind refactoring
  • /kind fix
  • /kind chore
  • /kind dependencies
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

@bharathvemula: There are no area labels on this PR. You can add as many areas as you see fit.

  • /area agent
  • /area local-api
  • /area cscli
  • /area appsec
  • /area security
  • /area configuration
Details

I am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository.

@bharathvemula

Copy link
Copy Markdown
Author

/kind bug

@bharathvemula

Copy link
Copy Markdown
Author

/area appsec

@bharathvemula

Copy link
Copy Markdown
Author

/kind bug

@bharathvemula

Copy link
Copy Markdown
Author

/kind bug
/area appsec

@bharathvemula

Copy link
Copy Markdown
Author

/kind fix

@blotus blotus closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Appsec: Incorrect URL parameter count with CRS

2 participants