Skip to content

Cannot match on query value when query string is separated by ; #1644

Description

@MarcWeustink

Describe the bug

A bot rule like:

    action: ALLOW
    expression:
      all:
        - path == "/index.php"
        - '"type" in query'
        - query["type"] == "rss"

a query string like index.php?type=rss;action=.xml;limit=1 gets challenged where a string like index.php?type=rss&action=.xml&limit=1 passes

Also a having a rule like - query["type"].startsWith("rss") doesn't match

Steps to reproduce

Use a query like index.php?type=rss;action=.xml;limit=1

Expected behavior

The query shouldn't get challenged.

Your operating system and its version.

Ubuntu 24.04.4 LTS + anubis_1.25.0_amd64

Your browser and its version.

curl

Additional context

According to the RFC anything beween a ? and a # is the query string. However how values are separated is not specified. A common practice is to use & but ; might also be uses (as well as anything else)
To handle those cases it would be nice to have a query_regex rule to match any part of the string (or at least to have an option how a string is split)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions