Skip to content
Access control Write-up Intermediate

How I Got My First CVE: Turning a Nexus Privilege Editor into an Admin

A user with permission to update privilege definitions could change a wildcard privilege assigned to their own role from a narrow pattern to a broad one, gaining administrator access. The attacker could then read users and create an account with the built-in admin role.

bebensap Follow

Published on bebensap.medium.com

Hacker

Bebensap, on bebensap.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

Sonatype Nexus Repository is a repository manager that organisations use to store and distribute internal packages and other artifacts. Access inside Nexus is built from three kinds of object: users, roles and privileges. A user receives roles, and each role contains privileges that define what the user can do. There are separate permissions for managing users, roles and privilege definitions.

The feature under review was delegated security administration, specifically the ability to update privilege definitions. The permission that gates this is:

Text
nexus:privileges:update

A user holding it can update privilege definitions. The question the researcher set out to answer was whether Nexus checked how much authority a delegated editor could put into a privilege. Being allowed to edit a definition is a powerful capability, particularly when the definition controls the editor's own access.

Wildcard privileges are the interesting case. A pattern such as nexus:metrics:read grants a narrow permission for reading metrics. Changing the pattern to nexus:* gives it administrative authority across Nexus. The open question was whether the update path stopped a delegated editor from making that change.

Setup

The testing was done on a local instance using the official Sonatype Docker image, running Nexus OSS 3.70.5-02.

The test account was called priveditor1. Its delegated role contained:

Text
nx-privileges-read
nx-privileges-update
delegated-self-priv

delegated-self-priv was a custom wildcard privilege with the pattern nexus:metrics:read. The account could therefore read and update privilege definitions and held the narrow metrics permission. It was not assigned the nx-admin role.

Two preconditions matter for the whole finding: the attacker needs permission to update privilege definitions, and a mutable custom wildcard privilege must already be assigned to their role. Built-in read-only privileges are protected from modification. Installing Nexus with its usual settings was enough for the lab, but the delegated role and the custom privilege still had to be configured by an administrator.

Finding it

The researcher followed the wildcard update endpoint through the code. The endpoint was:

Text
PUT /service/rest/v1/security/privileges/wildcard/{privilegeName}

In PrivilegeApiResource, it carried these authorization checks:

Text
@RequiresAuthentication
@RequiresPermissions("nexus:privileges:update")

The caller had to be authenticated and hold the privilege-update permission. That is the expected gate for a delegated editor.

The request was then followed into PrivilegeApiResourceSupport. After converting the submitted definition into a privilege object, the code copied its properties into the existing privilege and saved it:

Text
Privilege newPrivilege = apiPrivilege.asPrivilege();
Text
privilege.setDescription(newPrivilege.getDescription());
privilege.setProperties(newPrivilege.getProperties());
Text
authorizationManager.updatePrivilegeByName(privilege);

There were checks for the privilege name, validation through the descriptor, and protection against modifying read-only privileges. What the researcher could not find was a check on the permission being granted. The wildcard descriptor built the effective permission directly from the stored pattern using WildcardPermission2, and its validator did not restrict the submitted pattern either.

At that point the code suggested that a privilege editor could submit nexus:*. What remained was to confirm that the change would actually give the account administrator access.

Exploitation

Step 1: establish a baseline

Before touching the privilege, the researcher tried accessing the users API with the delegated account. Nexus returned 403 Forbidden. That gave a clear baseline: the account could not reach the users API and could not create administrator accounts.

Step 2: widen the assigned privilege

Using the delegated account, the researcher updated its own assigned custom privilege, changing the pattern from nexus:metrics:read to nexus:*. The update returned 204 No Content.

Step 3: retry the users API

The same credentials were used against the users API again. This time Nexus returned 200 OK. The account's role assignment had not changed; the updated privilege was already enough to give it access.

Step 4: confirm an administrative action

Listing users was a good result, but the researcher wanted to confirm a real administrative action. Using the escalated account, they created another local user with the built-in nx-admin role. Nexus accepted it and returned 200 OK.

The full sequence of results was:

Action Response
Read users before changing the privilege 403 Forbidden
Update the assigned wildcard privilege 204 No Content
Read users afterward with the same credentials 200 OK
Create another account with the nx-admin role 200 OK

That confirmed usable administrator access: the delegated account could now create a separate administrator account through the normal API.

Root cause

The role stored a reference to delegated-self-priv. When Nexus checked the account's permissions, it resolved that reference using the privilege's current definition. Originally the definition granted nexus:metrics:read; after the update it granted nexus:*. The role still referenced the same privilege, but the permission behind that reference had become much broader. This is why the path did not require changing the user's role or holding permission to update roles: editing an existing privilege had already changed what the role allowed.

Nexus also refreshed authorization after the update. The change triggered authorization events and the relevant cache was invalidated, so the next request picked up the new permission. The cache refresh was behaving as expected. The problem was that Nexus had accepted a privilege definition that the caller was not authorized to grant.

The missing restriction was on how much permission the update operation could grant. The endpoint checked that the caller could update privileges, but not whether the caller was entitled to grant the permission contained in the submitted definition. The wildcard descriptor built the effective permission straight from the stored pattern, and its validator did not restrict the pattern, so nexus:* was accepted.

Impact

The delegated account gained usable administrator access: it could read the users API and create a new local user holding the built-in nx-admin role. It could read the users API and create a new local user holding the built-in nx-admin role, both through the normal API.

For a company using Nexus to distribute internal packages, the consequences could go further. Administrative access could allow an attacker to alter repository configuration or interfere with artifacts consumed by other systems. Creating the administrator account was the impact demonstrated; interference with downstream builds and dependencies was a possible consequence of that level of access.

Exposure depended on how an administrator had delegated access: the attacker needed permission to update privilege definitions and a mutable custom wildcard privilege already assigned to their role. Sonatype accounted for this in the final severity assessment, setting Attack Requirements to Present (AT:P) and rating the issue High, 8.9 under CVSS v4.0. The finding became CVE-2026-17601.

From the original on bebensap.medium.com

Fix

According to the advisory, the affected versions are Nexus Repository 3.19.0 through 3.94.x, and the fix was released in 3.95.0. For customers who could not upgrade immediately, Sonatype recommended limiting privilege creation and update permissions to fully trusted administrators.

The researcher's own conclusion is that a fix has to evaluate the proposed privilege before saving it and check whether the caller is authorized to grant that permission. That check also needs to use the caller's authority before the update takes effect.

Variants to test

When reviewing similar systems, look beyond changes to role membership. A user may be able to edit a privilege, policy or permission definition that their existing role already depends on. Concrete things to try:

  1. Self-referencing definitions. Find any object the account can edit that its own role resolves at authorization time (privilege, policy, permission set). Change it to a broader value and re-request a resource that previously returned 403. A positive result is a 200 on the previously forbidden resource without any change to role membership.
  2. Wildcard widening. Where patterns are accepted, submit a broad pattern such as nexus:* in place of a narrow one. A positive result is a 204 on the update followed by access to administrative endpoints.
  3. Validator gaps. Check whether the descriptor's validator restricts the submitted pattern at all. If it does not, the effective permission is built directly from whatever is stored.
  4. Cache refresh behaviour. After an update, check whether authorization caches are invalidated. If the new permission takes effect on the next request, the escalation is immediate; if not, look for a way to force the refresh.
  5. Read-only protection boundaries. Confirm which objects are protected from modification and which are not. A positive result is a mutable custom object that the account's role already references.
  6. Grant-authority checks. For every update endpoint that accepts a permission-bearing object, test whether the server checks that the caller could grant the submitted permission, not just that the caller may perform the update.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 16 min read.

What happened, in plain words

A security researcher found a way for a limited user account on a piece of software called Sonatype Nexus Repository to give itself full administrator powers. The trick was to edit one small setting that the account was already allowed to edit, and to change it from a narrow permission into a very broad one. The account's role never changed, but the permission behind that role became much bigger. The researcher reported it, the software maker confirmed it, and the finding became a publicly tracked security flaw with the identifier CVE-2026-17601, rated High with a score of 8.9. Sonatype also awarded a $1,000 bounty, which is a payment some companies offer to people who report security problems responsibly.

This article walks through the whole story from the beginning, assuming you have never read a security report before. Every technical word is explained the first time it appears, and there is a glossary at the end.

The product and the feature

Sonatype Nexus Repository is a repository manager. Think of it as a large, well organised warehouse for software: companies put their own internal software packages (ready-made bundles of code that other programs install and use) into it, and other computers in the company fetch them from there. Because so much depends on what is in the warehouse, controlling who can change things inside it matters a lot.

Access inside Nexus is built from three kinds of object:

  • Users: individual accounts, each with a username and password.
  • Roles: named bundles of permissions, like job titles. A user is given one or more roles.
  • Privileges: the individual permissions themselves, such as "may read metrics" or "may update privilege definitions". A role contains privileges.

So the chain is: a user gets roles, and each role contains privileges that define what the user can do. There are separate permissions for managing users, managing roles, and managing privilege definitions.

The feature the researcher was reviewing is called delegated security administration. "Delegated" means the top administrator hands part of the security work to someone else, without making them a full administrator. For example, a company might let a team lead manage a few permissions without giving them the keys to everything. The specific delegated ability under review was the power to update privilege definitions, that is, to edit what a privilege means.

The permission that gates this ability is:

Text
nexus:privileges:update

This is a permission name, written as a colon-separated label. Reading it left to right: it belongs to the nexus system, it concerns privileges, and the action is update. A user holding it can update privilege definitions. The question the researcher set out to answer was simple to state: when a delegated editor edits a privilege, does Nexus check how much authority that editor is allowed to put into it? Being allowed to edit a definition is a powerful capability, particularly when the definition controls the editor's own access. It is a bit like letting someone edit the label on a door key: harmless if they can only rename it, dangerous if they can turn a key to the stationery cupboard into a master key.

Wildcard privileges are the interesting case. A wildcard is a symbol that stands for "anything". In a pattern such as nexus:metrics:read, the three parts mean: the nexus system, the metrics area, and the read action. That grants a narrow permission for reading metrics, which are numerical measurements about how the system is running. Changing the pattern to nexus:* replaces the last two parts with a star, meaning "anything at all in the nexus system". That gives the privilege administrative authority across Nexus. The open question was whether the update path stopped a delegated editor from making that change.

Setting up a test

The testing was done on a local instance, meaning a copy of Nexus running on the researcher's own computer rather than on a company server. It used the official Sonatype Docker image. Docker is a tool that packages software into a ready-to-run container, so you can start a program without installing it piece by piece; the image is the packaged copy. The version was Nexus OSS 3.70.5-02. OSS stands for open source software, the freely available edition.

The test account was called priveditor1. Its delegated role contained three entries:

Text
nx-privileges-read
nx-privileges-update
delegated-self-priv

Line by line: nx-privileges-read lets the account look at privilege definitions; nx-privileges-update lets it change them; and delegated-self-priv is a custom wildcard privilege, created for this test, with the pattern nexus:metrics:read. The account could therefore read and update privilege definitions and held the narrow metrics permission. It was not assigned the nx-admin role, which is the built-in role that means full administrator.

Two preconditions matter for the whole finding. First, the attacker needs permission to update privilege definitions. Second, a mutable custom wildcard privilege must already be assigned to their role; mutable means it can be changed, as opposed to read-only. Built-in read-only privileges are protected from modification. Installing Nexus with its usual settings was enough for the lab, but the delegated role and the custom privilege still had to be configured by an administrator. In other words, this is not a flaw that hits every installation out of the box; it hits installations where someone has set up this kind of delegation.

Finding it in the code

The researcher followed the wildcard update endpoint through the code. An endpoint is a specific address on a server that accepts a particular kind of request, much like a counter in a large office building: you go to the right counter for the service you want. This one was:

Text
PUT /service/rest/v1/security/privileges/wildcard/{privilegeName}

Reading it in pieces: PUT is the HTTP method used when you want to replace or update something (HTTP is the language browsers and servers use to talk to each other); /service/rest/v1/security/privileges/wildcard/ is the path, pointing at the wildcard privilege area of the security section; and {privilegeName} is a placeholder where the name of the privilege being edited goes. So the whole line means: "update the wildcard privilege with this name".

In a piece of code called PrivilegeApiResource, the endpoint carried these authorization checks:

Text
@RequiresAuthentication
@RequiresPermissions("nexus:privileges:update")

These two lines are annotations, labels attached to code that tell the framework (the underlying software that runs the application) to enforce a rule before the code runs. Line one, @RequiresAuthentication, means the caller must be logged in; authentication is proving who you are. Line two, @RequiresPermissions("nexus:privileges:update"), means the caller must hold that specific permission. The caller had to be authenticated and hold the privilege-update permission. That is the expected gate for a delegated editor: the front door is locked to anyone without the right badge.

The request was then followed into PrivilegeApiResourceSupport, a helper piece of code that does the actual saving. After converting the submitted definition into a privilege object, the code copied its properties into the existing privilege and saved it:

Text
Privilege newPrivilege = apiPrivilege.asPrivilege();

This line takes the definition the caller sent in (apiPrivilege) and turns it into an internal privilege object called newPrivilege. It is the moment the submitted data becomes something the system will act on.

Text
privilege.setDescription(newPrivilege.getDescription());
privilege.setProperties(newPrivilege.getProperties());

These two lines copy the submitted description and the submitted properties (the settings, including the pattern) from the new object onto the existing privilege. In plain terms: whatever the caller sent replaces what was there before.

Text
privilege.setDescription(newPrivilege.getDescription());
privilege.setProperties(newPrivilege.getProperties());
Text
authorizationManager.updatePrivilegeByName(privilege);

This line hands the modified privilege to the authorization manager, the component that keeps track of who may do what, and asks it to save the change under the privilege's name. After this, the new definition is live.

There were checks for the privilege name, validation through the descriptor, and protection against modifying read-only privileges. A descriptor is the piece of code that describes a particular kind of privilege and knows how to interpret it; validation means checking that the submitted data is well formed. What the researcher could not find was a check on the permission being granted. The wildcard descriptor built the effective permission directly from the stored pattern using WildcardPermission2, a class whose job is to turn a pattern like nexus:metrics:read into an actual permission the system can test against, and its validator did not restrict the submitted pattern either. In everyday terms: the system checked that the caller had a badge to enter the room, and checked that the form was filled in correctly, but never asked whether the caller was allowed to hand out the powers the form described.

At that point the code suggested that a privilege editor could submit nexus:*. What remained was to confirm that the change would actually give the account administrator access, because code reading alone is not proof.

Exploitation

Exploitation means actually carrying out the attack to show it works. It was done in four steps.

Step 1: establish a baseline

Before touching the privilege, the researcher tried accessing the users API with the delegated account. An API (application programming interface) is the set of addresses a program offers so other programs can ask it to do things; the users API is the part of Nexus that lets you list and create user accounts. Nexus returned 403 Forbidden. HTTP status codes are short numbers a server sends back to say how a request went: 403 means "I know who you are, and you are not allowed". That gave a clear baseline: the account could not reach the users API and could not create administrator accounts. A baseline is the "before" measurement, so that any later change can be attributed to the action taken in between.

Step 2: widen the assigned privilege

Using the delegated account, the researcher updated its own assigned custom privilege, changing the pattern from nexus:metrics:read to nexus:*. The update returned 204 No Content. A 204 means "done, and there is nothing to send back", which is the normal answer to a successful update. Note what was not needed here: no role change, no new permission, just an edit to a definition the account was already allowed to edit.

Step 3: retry the users API

The same credentials were used against the users API again. This time Nexus returned 200 OK, the standard "here is your answer" success code. The account's role assignment had not changed; the updated privilege was already enough to give it access. The same key, with the same label, now opened a different door, because the label itself had been rewritten.

Step 4: confirm an administrative action

Listing users was a good result, but the researcher wanted to confirm a real administrative action, not just a read. Using the escalated account, they created another local user with the built-in nx-admin role. Nexus accepted it and returned 200 OK. Creating a second administrator account is a strong demonstration: the attacker no longer needs the original account, because a fresh, fully privileged one now exists.

The full sequence of results was:

Action Response
Read users before changing the privilege 403 Forbidden
Update the assigned wildcard privilege 204 No Content
Read users afterward with the same credentials 200 OK
Create another account with the nx-admin role 200 OK

That confirmed usable administrator access: the delegated account could now create a separate administrator account through the normal API.

Why it worked

The role stored a reference to delegated-self-priv. A reference is not a copy; it is a pointer, like a line in a recipe book that says "use the sauce from page 12" rather than repeating the sauce recipe. When Nexus checked the account's permissions, it resolved that reference using the privilege's current definition, meaning it looked up page 12 at the moment of checking. Originally the definition granted nexus:metrics:read; after the update it granted nexus:*. The role still referenced the same privilege, but the permission behind that reference had become much broader. This is why the path did not require changing the user's role or holding permission to update roles: editing an existing privilege had already changed what the role allowed.

Nexus also refreshed authorization after the update. The change triggered authorization events and the relevant cache was invalidated, so the next request picked up the new permission. A cache is a fast temporary store of answers the system has already worked out, so it does not have to recalculate them every time; invalidating it means throwing the stored answers away so they are worked out fresh. The cache refresh was behaving as expected. The problem was that Nexus had accepted a privilege definition that the caller was not authorized to grant.

The missing restriction was on how much permission the update operation could grant. The endpoint checked that the caller could update privileges, but not whether the caller was entitled to grant the permission contained in the submitted definition. The wildcard descriptor built the effective permission straight from the stored pattern, and its validator did not restrict the pattern, so nexus:* was accepted. This kind of flaw, where a user can raise their own level of access, is called privilege escalation, and because the user does it to themselves, self-escalation.

Impact

The delegated account gained usable administrator access: it could read the users API and create a new local user holding the built-in nx-admin role. It could read the users API and create a new local user holding the built-in nx-admin role, both through the normal API.

For a company using Nexus to distribute internal packages, the consequences could go further. Administrative access could allow an attacker to alter repository configuration or interfere with artifacts consumed by other systems. An artifact is any file stored and distributed by the repository, such as a software package. Creating the administrator account was the impact demonstrated; interference with downstream builds and dependencies was a possible consequence of that level of access, not something the researcher carried out.

Exposure depended on how an administrator had delegated access: the attacker needed permission to update privilege definitions and a mutable custom wildcard privilege already assigned to their role. Sonatype accounted for this in the final severity assessment, setting Attack Requirements to Present (AT:P) and rating the issue High, 8.9 under CVSS v4.0. CVSS is a standard scoring system for security flaws; 8.9 out of 10 falls in the High band. Attack Requirements to Present means the scoring recognised that certain conditions had to exist before the attack would work. The finding became CVE-2026-17601. CVE stands for Common Vulnerabilities and Exposures: a public catalogue where each confirmed security flaw gets a permanent identifier so everyone can refer to the same thing.

From the original on bebensap.medium.com

The fix

According to the advisory, the affected versions are Nexus Repository 3.19.0 through 3.94.x, and the fix was released in 3.95.0. An advisory is the official public notice a vendor publishes about a security flaw. For customers who could not upgrade immediately, Sonatype recommended limiting privilege creation and update permissions to fully trusted administrators, which removes the precondition the attack depends on.

The researcher's own conclusion is that a fix has to evaluate the proposed privilege before saving it and check whether the caller is authorized to grant that permission. That check also needs to use the caller's authority before the update takes effect. In plain words: before writing the new definition down, ask "is this person allowed to hand out this much power?", and ask it while the old definition is still in force.

Variants to test

When reviewing similar systems, look beyond changes to role membership. A user may be able to edit a privilege, policy or permission definition that their existing role already depends on. Concrete things to try:

  1. Self-referencing definitions. Find any object the account can edit that its own role resolves at authorization time (privilege, policy, permission set). Change it to a broader value and re-request a resource that previously returned 403. A positive result is a 200 on the previously forbidden resource without any change to role membership.
  2. Wildcard widening. Where patterns are accepted, submit a broad pattern such as nexus:* in place of a narrow one. A positive result is a 204 on the update followed by access to administrative endpoints.
  3. Validator gaps. Check whether the descriptor's validator restricts the submitted pattern at all. If it does not, the effective permission is built directly from whatever is stored.
  4. Cache refresh behaviour. After an update, check whether authorization caches are invalidated. If the new permission takes effect on the next request, the escalation is immediate; if not, look for a way to force the refresh.
  5. Read-only protection boundaries. Confirm which objects are protected from modification and which are not. A positive result is a mutable custom object that the account's role already references.
  6. Grant-authority checks. For every update endpoint that accepts a permission-bearing object, test whether the server checks that the caller could grant the submitted permission, not just that the caller may perform the update.

Glossary

  • Advisory: an official public notice from a software vendor describing a security flaw, its affected versions and its fix.
  • Annotation: a label attached to code that tells the underlying framework to enforce a rule, such as requiring login.
  • API (application programming interface): the set of addresses and rules a program offers so other programs can ask it to do things.
  • Artifact: any file stored and distributed by a repository, such as a software package.
  • Attack Requirements to Present (AT:P): a CVSS v4.0 setting meaning that specific conditions must exist before the attack works.
  • Authentication: proving who you are, usually by logging in.
  • Authorization: deciding what an authenticated user is allowed to do.
  • Baseline: the "before" measurement taken so that later changes can be attributed to the action in between.
  • Bounty: a payment some companies offer to people who report security problems responsibly.
  • Cache: a fast temporary store of answers already worked out, so the system does not recalculate them every time.
  • Cache invalidation: throwing stored answers away so they are worked out fresh on the next request.
  • CVE (Common Vulnerabilities and Exposures): a public catalogue giving each confirmed security flaw a permanent identifier.
  • CVSS: a standard scoring system that rates the severity of security flaws, here version 4.0.
  • Delegated security administration: handing part of the security management work to a non-administrator account.
  • Descriptor: the piece of code that describes a kind of privilege and knows how to interpret it.
  • Docker: a tool that packages software into ready-to-run containers; an image is the packaged copy.
  • Endpoint: a specific address on a server that accepts a particular kind of request.
  • Framework: the underlying software that runs an application and provides features such as permission checks.
  • HTTP: the language browsers and servers use to talk to each other.
  • HTTP status codes: short numbers a server returns to say how a request went, such as 200, 204 and 403.
  • Metrics: numerical measurements about how a system is running.
  • Mutable: able to be changed, as opposed to read-only.
  • Nexus Repository: Sonatype's repository manager, used to store and distribute software packages.
  • OSS (open source software): the freely available edition of a product.
  • Permission: a single named ability, such as updating privilege definitions.
  • Privilege: in Nexus, a named permission definition that roles contain.
  • Privilege escalation: a flaw that lets a user raise their own level of access; self-escalation is when they do it to their own account.
  • PUT: the HTTP method used to replace or update something on a server.
  • Reference: a pointer to another object rather than a copy of it, resolved at the moment it is used.
  • Repository manager: software that stores and distributes software packages for an organisation.
  • Role: a named bundle of privileges, like a job title, given to users.
  • Validation: checking that submitted data is well formed and acceptable.
  • Wildcard: a symbol, here *, that stands for "anything".
  • Wildcard privilege: a privilege whose pattern can contain a wildcard, so one definition can cover many permissions.
  • 403 Forbidden: an HTTP status meaning the server knows who you are but you are not allowed.
  • 200 OK: the standard HTTP success status.
  • 204 No Content: an HTTP status meaning the request succeeded and there is nothing to send back, typical for a successful update.

More by bebensap

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.