Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
0870588c
Commit
0870588c
authored
8 years ago
by
Erik Johnston
Browse files
Options
Downloads
Plain Diff
Merge branch 'hotfixes-v0.16.1'
parents
6783534a
f90cf150
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.rst
+8
-0
8 additions, 0 deletions
CHANGES.rst
synapse/__init__.py
+1
-1
1 addition, 1 deletion
synapse/__init__.py
synapse/api/auth.py
+10
-5
10 additions, 5 deletions
synapse/api/auth.py
with
19 additions
and
6 deletions
CHANGES.rst
+
8
−
0
View file @
0870588c
Changes in synapse v0.16.1-r1 (2016-07-08)
==========================================
THIS IS A CRITICAL SECURITY UPDATE.
This fixes a bug which allowed users' accounts to be accessed by unauthorised
users.
Changes in synapse v0.16.1 (2016-06-20)
=======================================
...
...
This diff is collapsed.
Click to expand it.
synapse/__init__.py
+
1
−
1
View file @
0870588c
...
...
@@ -16,4 +16,4 @@
"""
This is a reference implementation of a Matrix home server.
"""
__version__
=
"
0.16.1
"
__version__
=
"
0.16.1
-r1
"
This diff is collapsed.
Click to expand it.
synapse/api/auth.py
+
10
−
5
View file @
0870588c
...
...
@@ -637,17 +637,22 @@ class Auth(object):
try
:
macaroon
=
pymacaroons
.
Macaroon
.
deserialize
(
macaroon_str
)
self
.
validate_macaroon
(
macaroon
,
rights
,
self
.
hs
.
config
.
expire_access_token
)
user_prefix
=
"
user_id =
"
user
=
None
user_id
=
None
guest
=
False
for
caveat
in
macaroon
.
caveats
:
if
caveat
.
caveat_id
.
startswith
(
user_prefix
):
user
=
UserID
.
from_string
(
caveat
.
caveat_id
[
len
(
user_prefix
):])
user_id
=
caveat
.
caveat_id
[
len
(
user_prefix
):]
user
=
UserID
.
from_string
(
user_id
)
elif
caveat
.
caveat_id
==
"
guest = true
"
:
guest
=
True
self
.
validate_macaroon
(
macaroon
,
rights
,
self
.
hs
.
config
.
expire_access_token
,
user_id
=
user_id
,
)
if
user
is
None
:
raise
AuthError
(
self
.
TOKEN_NOT_FOUND_HTTP_STATUS
,
"
No user caveat in macaroon
"
,
...
...
@@ -692,7 +697,7 @@ class Auth(object):
errcode
=
Codes
.
UNKNOWN_TOKEN
)
def
validate_macaroon
(
self
,
macaroon
,
type_string
,
verify_expiry
):
def
validate_macaroon
(
self
,
macaroon
,
type_string
,
verify_expiry
,
user_id
):
"""
validate that a Macaroon is understood by and was signed by this server.
...
...
@@ -707,7 +712,7 @@ class Auth(object):
v
=
pymacaroons
.
Verifier
()
v
.
satisfy_exact
(
"
gen = 1
"
)
v
.
satisfy_exact
(
"
type =
"
+
type_string
)
v
.
satisfy_
general
(
lambda
c
:
c
.
startswith
(
"
user_id =
"
)
)
v
.
satisfy_
exact
(
"
user_id = %s
"
%
user_id
)
v
.
satisfy_exact
(
"
guest = true
"
)
if
verify_expiry
:
v
.
satisfy_general
(
self
.
_verify_expiry
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment