Uploaded image for project: 'LLM AI Integration'
  1. LLM AI Integration
  2. LLMAI-213

The chat completions REST error path reflects the request origin in the CORS header

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 0.11
    • 0.9
    • None
    • Unknown
    • N/A

    Description

      getCompletions computes the allowed origin through CORSUtils.matchOrigin (allow-list of the chat origin configuration, null when the origin is not listed) and sets it on the success responses (about line 77). The RequestError branch (about line 105) sets Access-Control-Allow-Origin to the raw request origin instead, so any site gets a readable cross-origin answer for the error case. No Access-Control-Allow-Credentials header is set, so a browser does not send the wiki cookies on such a request and the readable content is the OpenAI-style error body (provider or model error text) only. Still an allow-list bypass and a disclosure of error details to arbitrary origins.

      Attachments

        Activity

          People

            ppantiru Paul Pantiru
            ppantiru Paul Pantiru
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: