---
meta:
  author: "Andrea Menin"
  enabled: true
  name: "920500.yaml"
  description: "Tests for backup or working file extensions"
tests:
  - test_title: 920500-1
    desc: "Check request filename ends with ~"
    stages:
      - stage:
          input:
            dest_addr: "127.0.0.1"
            port: 80
            method: "GET"
            uri: "/index.php~"
            headers:
              User-Agent: "ModSecurity CRS 3 Tests"
              Host: "localhost"
          output:
            log_contains: "id \"920500\""
  - test_title: 920500-2
    desc: "Check request filename contains file that ends with ~ but not at end of string (bypass)"
    stages:
      - stage:
          input:
            dest_addr: "127.0.0.1"
            port: 80
            method: "GET"
            uri: "/index.php~/foo/bar/"
            headers:
              User-Agent: "ModSecurity CRS 3 Tests"
              Host: "localhost"
          output:
            log_contains: "id \"920500\""
  - test_title: 920500-3
    desc: "Rules 920500 should not block user dir such as /~user/"
    stages:
      - stage:
          input:
            dest_addr: "127.0.0.1"
            port: 80
            method: "GET"
            uri: "/~user/"
            headers:
              User-Agent: "ModSecurity CRS 3 Tests"
              Host: "localhost"
          output:
            no_log_contains: "id \"920500\""
