openresty / openresty/lua-nginx-module

ngx.re.match throw exception when match �

Open
#786 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

Hello,Agentzh:
I use Lua to build a WAF on nginx, but I met a problem that When I request a URI like "1.php?id=1%df%27%20and%20%271%27=%271"
The ngx.re.match throw a exception:
pcre_exec() failed: -10 on "1�' and '1'='1" using

but when I give Chinese to it, it works.
1.php?id=%E6%88%91%E6%98%AF%E4%BD%A0 

Can you help me to solve the problem , thank you very much.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported URI with ngx.re.match and inspect the pcre_exec() -10 failure on the decoded input. Compare that behavior with the Chinese URI example, then determine the expected handling for the reported match failure and document or test the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.