LogoLogo
  • ShieldsGuard - User Guide
  • Installation Steps
    • Shields Guard Installation
    • Shields Guard SEG Installation
  • Getting Started
    • 1. General Welcome and Site Management Panel
    • 2. Overview
      • 2.1 Today's Data
      • 2.2 Country Statistics
      • 2.3 URL Statistics
      • 2.4 IP Statistics
      • 2.5 HTTP Status Statistics
    • 3. Protection
      • 3.1 DDoS Protection
        • 3.1.1 Google Recaptcha Setup
        • 3.1.2 Friendly Captcha Setup
      • 3.2 WAF – Web Application Firewall
    • 4. Security Rules
      • 4.1 BlackList & WhiteList
      • 4.2 User Agent Filtering
      • 4.3 Query String Filtering
      • 4.4 HTTP Header Filtering
      • 4.5 Block POST Values
      • 4.6 Custom Headers
      • 4.7 Block URL Requests
      • 4.8 URL Path Blocking
      • 4.9 Encrypt Path
      • 4.10 Remove Request Value
      • 4.11 Exclude Directories from Protection
    • 5. Logs
      • 5.1 Access Log
      • 5.2 Security Log
    • 6. Asset Management
      • 6.1 Asset Management
      • 6.2 Network Topology
      • 6.3 Vulnerability Scan
    • 7. Access
  • 8. DNS
  • 9. SSL
  • 10. Subdomain Manage
  • 11. Edit Page
  • ShieldsGuard SEG
    • 1. SEG Dashboard
    • 2. Reporting
    • 3. Analyzed
      • 3.1 Files
      • 3.2 URL
      • 3.3 Mail
      • 3.4 Domain
    • 4. Mail Settings
      • 4.1 File
      • 4.2 Mail Body
      • 4.3 Sender Domain
Powered by GitBook
On this page
Export as PDF
  1. Getting Started
  2. 4. Security Rules

4.3 Query String Filtering

Previous4.2 User Agent FilteringNext4.4 HTTP Header Filtering

Last updated 9 days ago

πŸ“– Overview

The Query String Filtering module enables you to control and sanitize the query parameters (GET variables) attached to incoming requests.

By defining allowed or blocked query strings on a per-path basis, you can protect sensitive endpoints, APIs, and web forms against tampering, injection, or unexpected behavior.

This adds a powerful application-layer control that complements WAF rules and general request validations.


🎯 Purpose

  • Allow only expected parameters on specific pages.

  • Block unexpected or malicious parameters.

  • Remove untrusted query parameters automatically.

  • Harden API endpoints, authentication flows, and payment pages.


βœ… How It Works

You define rules specifying:

  • Target Page Path: (e.g., /login, /api/user/info, /checkout)

  • Allowed Query Keys: (e.g., email, token, id)

When a request is made:

  • Only the listed keys are allowed.

  • Any additional parameters are either removed or blocked based on configuration.


πŸ“‹ Example

Allowed Keys for /login

  • email

  • redirect_uri

Incoming Request:

/login?email=user@example.com&admin=true

Behavior:

  • admin=true is removed or causes a block, depending on rule setting.


πŸ› οΈ Configuration Options

  • Allow Only These Keys: Block or strip any parameter not explicitly listed.

  • Action Mode:

    • Remove unauthorized arguments silently

    • Block the request if unauthorized arguments are detected

  • Multiple Rules: Create multiple rules for different paths.


πŸš€ Use Cases

Scenario
Benefit

Protect login and signup endpoints

Prevent parameter injection

Secure API requests

Enforce strict parameter structure

Harden payment callbacks

Only allow signed, expected arguments

Reduce attack surface

Disallow noisy or unnecessary parameters


🧠 Best Practices

  • Whitelist only absolutely necessary parameters.

  • Avoid allowing β€œdebug”, β€œtest”, or unused parameters on production systems.

  • Combine Query String Filtering with WAF to maximize protection.

  • Review URL patterns regularly as your application evolves.


βš™οΈ How to Add a Query String Filter

  1. Go to Security Rules > Query String Filtering.

  2. Click Add New Rule.

  3. Enter the Page Path.

  4. Define all allowed query keys.

  5. Choose the action (Remove unauthorized / Block unauthorized).

  6. Save the rule.

πŸ›‘οΈ The rule will be active immediately for all matching requests.


⚑ Important Notes

  • Query filtering happens before request routing to backend servers.

  • Filtering is case-sensitive for parameter names.

  • Be cautious on dynamic URLs where parameters may vary unexpectedly.


🎯 By enforcing strict query string structures, you prevent misuse, abuse, and accidental exposure of your application's internal logic.