Skip to content

Answer confirmation Since v0.2 ​

Some probes are ordinary text by themselves: a lone quote, a'"><123>, //other.host. No request rule blocks them without causing false positives. Answer confirmation lets such a request through, reads the answer, and refuses the answer when it proves the attack. In detect mode the proof is recorded.

Before you begin ​

  • Role: operator for the application.
  • The setting is on by default. It works only while signatures are enabled.

How the rules decide ​

Rule IDAttackTrigger in the requestProof in the answer
200200SQL injectionA parameter with a quote, backtick or backslash.A database error: the CRS 951 leakage patterns plus our own (for example SQLITE_ERROR, java.sql.SQL...Exception, Sequelize and MongoDB JSInterpreterFailure errors).
200210Reflected injectionA quote followed by < or > and a tag ("><b>).The same markup unescaped in an HTML answer. HTML that a user typed, such as <p class="x">, is not a breakout.
200220Open redirectAn absolute or protocol-relative URL (https://host, //host) in a parameter.A 3xx answer whose Location sends the client to that host, when it is not the request's own host, one of the application's hostnames, or an allowed redirect host.

The event names the rule, the trigger parameter and its value, and the evidence from the answer: the database error, the reflected markup with its surroundings, or the Location.

Turn answer confirmation off or set allowed redirect hosts ​

text
1. Open Applications > All applications, and select the application.
2. In the application menu, open Request checks > Signatures.
3. Set Confirm probes in the answer, and list Allowed redirect hosts.
4. Select Preview changes, add a comment and select Apply.
sh
waap apps set -app shop -m "allow sign-in redirects" policy.signatures.allowed_redirect_hosts=login.example.net,*.pay.example.org
waap apps set -app shop -m "no answer checks" policy.signatures.answer_confirmation=false
yaml
applications:
  - name: shop
    policy:
      signatures:
        answer_confirmation: true
        allowed_redirect_hosts: [login.example.net, "*.pay.example.org"]

Settings reference ​

Answer confirmation ​

SettingWhat it doesDefaultAllowed valuesApplies in
Confirm probes in the answer (policy.signatures.answer_confirmation)Checks the answers of probe-shaped requests and refuses (detect: records) a confirmed attack.truetrue, falsesignatures enabled; refuses only in block mode
Allowed redirect hosts (policy.signatures.allowed_redirect_hosts)Hosts besides the application's own that its redirects may send clients to, such as a sign-in or payment service. A leading *. matches any subdomain.noneup to 256 hostsrule 200220

How much of the answer is read ​

Only marked requests have their answer body read, at most the first 128 KiB. For redirects only the headers are read. The upstream's compression is left alone: gzip and deflate answers are decoded, br and zstd answers are not checked.

Examples ​

Allow redirects to a payment provider and its subdomains:

yaml
policy:
  signatures:
    allowed_redirect_hosts: [pay.example.org, "*.pay.example.org"]

Except 200200 on a page that shows database errors by design:

yaml
# applications[].policy.exceptions
- name: sql-console
  when: {paths: ["/admin/sql"]}
  ignore_rules: [200200]

Limits ​

LimitValue
Allowed redirect hosts256
Answer body readfirst 128 KiB
Compression checkedgzip, deflate

Troubleshooting ​

A redirect to a sign-in service is refused with 200220 ​

  • Cause: the redirect host is in a parameter and is not the application's own host.
  • Fix: add the host under Allowed redirect hosts.

An answer with a database error is not refused ​

  • Cause: the request had no probe-shaped parameter, or the answer is compressed with br or zstd.
  • Check: the request trace shows whether the confirmation step ran.
  • Fix: ask the upstream not to compress with br or zstd, or rely on the request rules.