aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-07-04 00:25:01 +0200
committerMartin Fischer <martin@push-f.com>2021-07-04 11:19:41 +0200
commitc0b8d6a9876a95bc5d8fd8a30333e65949f5c9d1 (patch)
tree40bfa7846a11fae026f45aefb3b1a87dbfa59ec6 /src/error.rs
parent17d98a70a76efc02f643e9cfe13836120a2c5114 (diff)
strictly enforce Host and Origin headers
Previously the Origin header was only checked if you specified an origin with --origin on startup and when you didn't we just printed a warning that this might make you vulnerable to CSRF attacks. I implemented it this way since I wanted GitPad to be runnable without any command-line options, but such warnings are of course suboptimal for security since they can simply be ignored. This commit changes this behavior so that the Origin header is always checked for POST requests. If you just run "gitpad" the enforced origin defaults to http://127.0.0.1:<port>. Additionally this commit also enforces an exact Host header (extracted from the Origin) to prevent DNS rebinding attacks.
Diffstat (limited to 'src/error.rs')
0 files changed, 0 insertions, 0 deletions