Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
7cdf00d7
Commit
7cdf00d7
authored
Dec 17, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registry: fix security of some RPC when serving behind proxy
parent
3b5d03e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
registry.py
re6st/registry.py
+7
-4
No files found.
re6st/registry.py
View file @
7cdf00d7
...
...
@@ -161,11 +161,14 @@ class RegistryServer(object):
# (IOW, do the contrary of newPrefix)
self
.
timeout
=
not_after
and
not_after
+
GRACE_PERIOD
def
handle_request
(
self
,
request
,
method
,
kw
):
def
handle_request
(
self
,
request
,
method
,
kw
,
_localhost
=
(
'127.0.0.1'
,
'::1'
)):
m
=
getattr
(
self
,
method
)
if
method
in
(
'versions'
,
'topology'
,)
and
\
request
.
client_address
[
0
]
not
in
(
'127.0.0.1'
,
'::1'
):
return
request
.
send_error
(
httplib
.
FORBIDDEN
)
if
method
in
(
'versions'
,
'topology'
):
x_forwarded_for
=
request
.
headers
.
get
(
'X-Forwarded-For'
)
if
request
.
client_address
[
0
]
not
in
_localhost
or
\
x_forwarded_for
and
x_forwarded_for
not
in
_localhost
:
return
request
.
send_error
(
httplib
.
FORBIDDEN
)
key
=
m
.
getcallargs
(
**
kw
)
.
get
(
'cn'
)
if
key
:
h
=
base64
.
b64decode
(
request
.
headers
[
HMAC_HEADER
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment