Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix unauthorized access and modification of project data (CVE-2020-15120
)

An authenticated member of one project can modify and delete members of
another project, without knowledge of this other project's private
code. This can be further exploited to access all bills of another project
without knowledge of this other project's private code.

With the default configuration, anybody is allowed to create a new
project. An attacker can create a new project and then use it to become
authenticated and exploit this flaw. As such, the exposure is similar to
an unauthenticated attack, because it is trivial to become authenticated.

This issue was caused by a wrong database queries in PersonQuery.

For more details, see GHSA-67j9-c52g-w2q9
  • Loading branch information
Baptiste Jonglez authored and zorun committed Jul 26, 2020
1 parent 040d76a commit 8d77cf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ihatemoney/models.py
Expand Up @@ -380,7 +380,7 @@ class PersonQuery(BaseQuery):
def get_by_name(self, name, project):
return (
Person.query.filter(Person.name == name)
.filter(Project.id == project.id)
.filter(Person.project_id == project.id)
.one()
)

Expand All @@ -389,7 +389,7 @@ def get(self, id, project=None):
project = g.project
return (
Person.query.filter(Person.id == id)
.filter(Project.id == project.id)
.filter(Person.project_id == project.id)
.one()
)

Expand Down

0 comments on commit 8d77cf5

Please sign in to comment.