Skip to content

REQUEST_URI data is broken #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brenosilva opened this issue Apr 4, 2013 · 5 comments
Closed

REQUEST_URI data is broken #60

brenosilva opened this issue Apr 4, 2013 · 5 comments

Comments

@brenosilva
Copy link
Contributor

When i submit a request like

www.192.168.0.102/admin

and the rule follow is fired:

SecRule REQUEST_URI "(^/admin)"
"id:'10',
t:none,
phase:1,
log,
deny,
status:403"

I see in debug log:

[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][5] Rule 89f6670: SecRule "REQUEST_URI" "@rx (^/admin)" "phase:1,auditlog,id:10,t:none,log,deny,status:403"
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][4] Transformation completed in 4 usec.
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][4] Executing operator "rx" with param "(^/admin)" against REQUEST_URI.
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][9] Target value: "/usr/local/nginx/html/admin?"
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][6] Ignoring regex captures since "capture" action is not enabled.
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][4] Operator completed in 44 usec.
[04/Apr/2013:10:17:41 --0700] [/sid#89e6618][rid#8a2f780][/admin][4] Rule returned 0.

@brenosilva
Copy link
Contributor Author

Looks like the req->path_info is not the right data to use.

@chaizhenhua
Copy link
Contributor

now in nginx req->path_info = req->filename;; what value should it use ?

@brenosilva
Copy link
Contributor Author

Looks like it is fixed in the trunk

r->uri

Let me confirm. I'm compiling the trunk

@brenosilva
Copy link
Contributor Author

Yes. it is fixed in the trunk. closing it

@brenosilva
Copy link
Contributor Author

It was
req->parsed_uri.path = req->path_info
But in the trunk it is right
req->parsed_uri.path = (char *)ngx_pstrdup0(r->pool, &r->uri);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants