Zero-DayDA1MON
8 min read
November 21, 2026

One Bad Condition and Every Account Sees Other People's Email. Broken Access Control in mwdb-core

One Bad Condition and Every Account Sees Other People's Email. Broken Access Control in mwdb-core

Access control bugs rarely stand out when you read the code. They usually come down to a single condition that checks almost the right thing, because instead of asking about the type of a group it asks about its name.

This one sat in mwdb-core, the open-source malware sample database developed by CERT Polska, in version 2.20.0. We found it white-box, by reading the public repository. DA1MON needed about five minutes for that. Then came the proof on a live instance, a report to the bug bounty program, and the answer: duplicate. As with dns.pl, what decided it was that we started too late.

TL;DR - Key takeaways

  • What the endpoint does
  • A condition that checked a name instead of a type
  • Proof on a live instance
  • Risk assessment

What the endpoint does

In mwdb-core every logged-in user has a profile. The profile holds a login, an email address, a registration time, and a last login time. The API endpoint that returns it takes the login in the path.

There was exactly one protection: a decorator requiring authentication. The endpoint checked neither a capability such as manage_users nor a user role, so simply being logged in was enough for it to start working.

From there the code splits into two paths. An account with the user management privilege reads any profile, which is fine, because that is how an administrator is meant to work. An account without that privilege was supposed to see only people it shares a workspace with. That second condition is the one that was written wrong.

A condition that checked a name instead of a type

Groups in mwdb carry a flag saying whether they are a workspace. A workspace is a place where people actually work together and know that the others exist. Alongside them are technical groups that the system adds accounts to automatically.

The branch for accounts without administrative privileges filtered groups by name: it skipped the group named "public" and checked whether both people were in the same group. The problem is that every account in the system also belongs to a default group covering all registered users. That group is not a workspace, but it is named something other than "public", so it passed the filter.

# Checking the group's name. The default group of all registered users # passes, so the condition holds for any pair of accounts. .filter(Group.name != "public") .filter(Group.is_member(g.auth_user.id))

# Checking the group's type. Only a workspace lets you # see its other members. .filter(Group.workspace.is_(True)) .filter(Group.is_member(g.auth_user.id))

Notably, the correct pattern is used elsewhere in the same project, and a comment next to the group model states plainly that only workspace groups should allow listing other members. The intent was documented well; it was this one condition that drifted away from it.

Why this is a classic

Broken Access Control has topped the OWASP Top 10 since 2021. In code it usually looks like an ordinary condition written in a hurry, which nobody later checked for whether it actually restricts access.

Diagram: the registered group belongs to every account, so a filter on the group name always passes
The registered group is not a workspace, yet every account belongs to it. A filter on the group name lets it through; a filter on the workspace flag rejects it.

Proof on a live instance

The code analysis only produced a hypothesis. We proved it on an account with the lowest privileges, created through the normal registration path and approved by an administrator. The account had neither the user management privilege nor access to all objects.

From such an account, knowing only the target's login, a single GET request with an API token was enough to receive the email address, the registration date, and the last login time.

GET /api/profile/{login} Host: {mwdb-instance} Authorization: Bearer {token of an ordinary account} 200 OK {"login":"...", "email":"...", "registered_on":"...", "logged_on":"..."}

The responses confirmed two things. First, the access covered every registered account, including people outside the organisation running the service, which means private and corporate addresses belonging to other parties. Second, the endpoint worked as a login oracle: an existing account returned 200, a non-existent one 404.

We are not publishing the specific logins and addresses, because they belong in the report to the system owner.

From a login to a person

More than an email address leaked here. Given a handle from a public community channel or a CTF, an attacker gets that person's private address and their hours of activity. That is enough for targeted phishing and for correlating identities across services.

Risk assessment

We scored it preliminarily at 5.3 on CVSS 4.0, which is medium. The score is lower than it might seem, because an attacker needs some account, and higher than the word "profile" suggests, because personal data of people outside the organisation leaks.

Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N. Low privileges required, no victim interaction, impact on confidentiality only.

  • Bulk harvesting of email addresses: all you need is a list of logins, and that can be built from public sources or guessed.
  • Deanonymisation of participants, because the service brings together analysts from different organisations.
  • Account enumeration through the difference between a 200 and a 404 response.
  • Data leaking between organisations, not only inside one.

How to fix it and how to avoid a repeat

The fix itself is a one-liner: filter on the workspace flag instead of the group name. The more interesting part is what it takes to stop a condition like this from coming back in another endpoint six months later.

  • One function instead of a repeated condition. If the rule "you see the people you share a workspace with" is written in several places, sooner or later one of them will drift. Pull it into a single function and call only that.
  • A test that checks the denial. Tests usually check that an authorised user can see something. The other half is missing: that an unauthorised one gets a 403 or a 404. Every endpoint returning someone else's data should have a test with an account without privileges.
  • Do not base permissions on names. A group name can be changed and a new group added at any time. A permission should follow from the object's type or from a flag, because only those are part of the data model.
  • Separate technical data from contact data. A profile endpoint for other users does not need to return an email address or a last login time. The fewer fields in the response, the less data leaks during the next bug.

A code review will not catch this on its own

The faulty condition looked reasonable and passed review. What catches it is the collision between the code and production data: how many groups exist, which of them are default, and who belongs to them. That is why code analysis and a test on a live instance belong together.

What can be sped up in a test like this, and what cannot

This case shows nicely which part of the work benefits from a swarm of agents and which does not.

Reading through the project's sources, finding endpoints without a required capability, and comparing them against the pattern used elsewhere is work where the swarm is fast, because it reads many files in parallel. Reaching the hypothesis took about five minutes.

The rest went at the usual pace: creating an account, waiting for approval, preparing the proof, masking the data of people the case does not concern, and writing it all up so the recipient can reproduce it. That part cannot be sped up, and it is what decides whether a report is worth anything.

The report came back as a duplicate. We measure the time to a confirmed finding rather than points in a program, so the result is still useful to us.

Summary

In mwdb-core 2.20.0 the endpoint returning a user profile required only authentication. The branch for accounts without administrative privileges was meant to limit visibility to a shared workspace, but it filtered groups by name instead of by the type flag. The default group covering all registered users passed that filter, so any account could read the email address, registration time, and last login time of every other user, including users from other organisations. The hypothesis came from reading the public repository in about five minutes, and we confirmed it on a live instance from an account with the lowest privileges.

Frequently asked questions

What is Broken Access Control?

It is a situation where the system checks who you are but does not correctly check what you are allowed to see or do. Here the endpoint required a login and stopped verifying there, because the condition limiting visibility to a shared workspace was written so that every account satisfied it. OWASP has placed this category at the top of its list since 2021.

Why is leaking just an email address a problem?

Because an address rarely leaks on its own. Here it came with a login, a registration time, and a last login time, and the service brings together analysts from different organisations. Given a handle from a public channel, you can match a private address and hours of activity to it. That is material for targeted phishing and for linking identities across services, and with personal data the GDPR applies as well.

How do I check whether I have a similar bug?

List every endpoint that returns another user's data and answer two questions for each: which privilege is required beyond being logged in, and how the code decides that both users are allowed to see each other. If the second answer is "by group name" or "because some shared link exists", verify it against production data. Then add a test in which an account without privileges is denied.

Is code analysis enough to report a vulnerability?

No. The code tells you a condition is too weak, but only the data tells you whether it can be walked through in practice. Here the key fact was that the system contains a default group joining every account. That is why we confirmed the repository hypothesis with a request from a low-privileged account on a live instance before sending the report.

What does it mean that the report was a duplicate?

That somebody described the same vulnerability earlier. In bug bounty programs the first report gets the points, regardless of whether later ones are more precise. A different result mattered to us: how long it takes to get from a public repository to a confirmed hypothesis. It came out at about five minutes.

Bibliography

1
OWASP Top 10:2021 - A01 Broken Access Control

The category that has opened the OWASP Top 10 since 2021, with the typical patterns of access control failures.

2
CWE-639: Authorization Bypass Through User-Controlled Key

The classification for bugs where an identifier supplied by the user decides access to someone else's data.

3
mwdb-core (GitHub, CERT Polska)

The open-source malware sample database developed by CERT Polska. The analysis concerned version 2.20.0.

4
FIRST - CVSS v4.0 Calculator

The calculator we used for the preliminary score in this report.

5
DA1MON - continuous penetration testing by PWNONE

How the swarm of agents that ran the reconnaissance for this report works, and where in the process a human steps in.

Who checks that your access denials actually work?

We test applications from the permissions side: what an account with no role can see, what endpoints return for someone else's identifier, and where access control rests on a name instead of a type. DA1MON runs the reconnaissance and a pentester confirms every finding.

Order a penetration test