Skip to content

A plugin to check for proxy_pass usage resulting in decoding and normalization#15

Merged
dvershinin merged 6 commits intodvershinin:masterfrom
MegaManSec:master
Feb 16, 2025
Merged

A plugin to check for proxy_pass usage resulting in decoding and normalization#15
dvershinin merged 6 commits intodvershinin:masterfrom
MegaManSec:master

Conversation

@MegaManSec
Copy link

@MegaManSec MegaManSec commented Feb 15, 2025

Also add proper requirements, and fix some typos and warnings on newer Python versions.

More information about dangerous proxy_pass usage: https://joshua.hu/proxy-pass-nginx-decoding-normalizing-url-path-dangerous#nginx-proxy_pass

P.S: Thank you for this fork!

…alization.

Also add proper requirements, and fix some typos and warnings on newer Python
versions.
Copy link
Owner

@dvershinin dvershinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR, there are some things to address so that tests pass without errors.

@sonarqubecloud
Copy link

@dvershinin dvershinin merged commit 98ab5e3 into dvershinin:master Feb 16, 2025
10 checks passed
@dvershinin
Copy link
Owner

Thanks! Merged.

@SuperSandro2000
Copy link

Should this rule also apply when proxying a file? I am not sure and I also have no idea how to fix this:

location /dir/file {
  proxy_pass http://server/dir/file?query=value;
}

@MegaManSec
Copy link
Author

MegaManSec commented Feb 17, 2025

@SuperSandro2000 :

First off, this should use location = /dir/file { because it currently matches /dir/file123123123.

Second off, use:

location = /dir/file {
  proxy_pass http://server$1?query=value;
}

@MegaManSec
Copy link
Author

MegaManSec commented Feb 17, 2025

@SuperSandro2000 I've fixed try the rule from above. $1 is the correct thing to use here, and does not qualify as a path.

@SuperSandro2000
Copy link

First off, this should use location = /dir/file { because it currently matches /dir/file123123123.

Should gixy warn about this?

@MegaManSec
Copy link
Author

It currently warns about it if alias is used: https://github.com/dvershinin/gixy/blob/master/docs/en/plugins/aliastraversal.md

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

Successfully merging this pull request may close these issues.

3 participants