openapi: 3.0.3

info:
  title: BRAGER — public CRA reporting API
  version: "1.0.0"
  description: |
    Public intake for vulnerability and security incident reports, plus a status lookup for
    the person who submitted one. The channel implements the obligation from Article 13(17)
    of Regulation (EU) 2024/2847 (Cyber Resilience Act): **anyone** must be able to report a
    vulnerability, without an account in the manufacturer's systems.

    ## Getting access

    If you want to report vulnerabilities through this API, write to
    **security@brager.com.pl** to obtain your own channel token.

    The token shown in the examples —
    `5DAZHyr2QplqXFJsY4FzyaaSiTtxnd1lCrp57Y5boU8` — is a **sandbox token**. It exists so
    that you can try the calls out: requests are validated and answered exactly as on a real
    channel, and you get a case number and a tracking token back.

    What differs is what happens afterwards. A sandbox case is **closed immediately**, with
    a note explaining where it came from. It never reaches the security team, starts no
    Article 14 deadlines and triggers no e-mail. Its status endpoint answers `rejected`.

    Sandbox cases are also numbered in their own series — `CRA-TEST-2026-001` rather than
    `CRA-2026-001` — so they never consume numbers from the real register.

    Use your own token for anything you want us to act on.

    ## Authentication

    These endpoints require no login. The URL carries a `token` identifying the reporting
    channel (a form on the website, an entry in `security.txt`, a partner channel).

    The token is **public by design**: it ships in the page source and grants no access to
    the register — only the ability to submit a report. The manufacturer can revoke it at
    any time, after which the endpoints answer `404`.

    ## Scope

    These endpoints only **accept** a report and return its coarse status. Severity, the
    decision on whether to notify CSIRT/ENISA, the Article 14 deadlines, internal notes and
    the rest of the register are not publicly available — not even to the person who filed
    the report.

    ## Rate limits

    By default **5 requests per hour from one IP address** and 60 per hour per channel. The
    manufacturer may change the former for a given channel. Exceeding it returns `429`.

    The limit covers **both** endpoints: checking a report status draws on the same budget
    as submitting reports. Do not poll the status endpoint.

  contact:
    name: BRAGER — security team
    email: security@brager.com.pl

servers:
  - url: https://io.brager.pl
    description: Production

tags:
  - name: Reports
    description: Submitting a report and checking its status

paths:
  /v1/public/cra/{token}/reports:
    post:
      tags: [Reports]
      summary: Report a vulnerability or incident
      operationId: submitPublicReport
      description: |
        Accepts a report and opens a case in the manufacturer's register.

        Only three fields are required: `entryType`, `title` and `description`. Contact
        details are optional — anonymous reports are accepted too, but without an e-mail
        address the manufacturer cannot ask for details or tell you the outcome.

        Fields that carry an assessment — severity, status, the reporting decision, the
        moment of awareness (T0) — **are not accepted here**. The manufacturer's team sets
        them, because its Article 14 obligations depend on them.

        The response returns the case number and a `trackingToken`: a one-off key for
        checking the status. It cannot be recovered later, so store it.
      parameters:
        - $ref: "#/components/parameters/ChannelToken"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReportRequest"
            examples:
              minimal:
                summary: Anonymous report, required fields only
                value:
                  entryType: vulnerability
                  title: Buffer overflow in the Wi-Fi module
                  description: >-
                    Sending a frame longer than 512 bytes to the service on port 8080 reboots
                    the controller. Reproduced on two units, firmware 3.4.1.
              full:
                summary: Report with contact details and affected products
                value:
                  entryType: vulnerability
                  title: Buffer overflow in the Wi-Fi module
                  description: >-
                    Sending a frame longer than 512 bytes to the service on port 8080 reboots
                    the controller. Reproduced on two units.
                  exploitationObserved: false
                  locale: en
                  reporterName: Jane Doe
                  reporterEmail: jane.doe@example.com
                  reporterKind: researcher
                  reporterOrganization: Example Security
                  reporterContactConsent: true
                  affectedProducts:
                    - productName: Example Controller 100
                      productVersion: 3.4.1
                      productModel: EX-100
                      hardwareVersion: "2.1"
                    - productName: Example Controller 100 Lite
                      productVersion: 3.4.0
      responses:
        "201":
          description: Report accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportAccepted"
              example:
                reference: CRA-2026-014
                trackingToken: 7fUFHfDd5RVXGMxTmQx2J-B0qPdcyqqlMPho3cqPFb0
                message: Report accepted. Keep the case number for further correspondence.
        "202":
          description: |
            Request acknowledged but **not stored**, because automated abuse screening
            rejected it. A well-formed request from an integration will not hit this.
            The response shape deliberately resembles `201`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportAccepted"
              example:
                reference: null
                message: Report accepted.
        "404":
          $ref: "#/components/responses/UnknownChannel"
        "422":
          $ref: "#/components/responses/ValidationFailure"
        "429":
          $ref: "#/components/responses/TooManyRequests"

  /v1/public/cra/{token}/reports/{trackingToken}:
    get:
      tags: [Reports]
      summary: Check report status
      operationId: getPublicReportStatus
      description: |
        Returns the coarse status of a case to the person who reported it.

        The key is the `trackingToken` issued on submission, **not** the case number: case
        numbers run in sequence (`CRA-2026-001`, `-002`, …), so an address based on them
        would let a stranger walk the whole register by guessing. The channel token is not
        enough either, because it is public.

        The response carries only what the reporter supplied (number and title), a status
        and two timestamps. Severity, the reporting decision, Article 14 deadlines and the
        team's findings stay inside the register.

        Note: this request draws on the same rate limit budget as submitting reports.
      parameters:
        - $ref: "#/components/parameters/ChannelToken"
        - name: trackingToken
          in: path
          required: true
          description: The key returned when the report was accepted. 43 characters, `base64url` alphabet.
          schema:
            type: string
            minLength: 43
            maxLength: 43
            pattern: "^[A-Za-z0-9_-]{43}$"
          example: 7fUFHfDd5RVXGMxTmQx2J-B0qPdcyqqlMPho3cqPFb0
      responses:
        "200":
          description: Case status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReportStatus"
              example:
                reference: CRA-2026-014
                title: Buffer overflow in the Wi-Fi module
                state: in_review
                submittedAt: "2026-09-08T09:14:00.000+02:00"
                updatedAt: "2026-09-08T11:02:31.000+02:00"
        "404":
          description: |
            No case found for this key — either the key is wrong or the channel has been
            revoked. The answer is the same in both cases, so as not to confirm that a
            channel or a case exists.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Message"
              example:
                message: No report found for this identifier.
        "429":
          $ref: "#/components/responses/TooManyRequests"

components:
  parameters:
    ChannelToken:
      name: token
      in: path
      required: true
      description: |
        Public reporting channel token issued by the manufacturer. Public by design;
        revoking the channel results in a `404`. Request one at security@brager.com.pl.

        The value below is the **sandbox token** — good for trying the API out. Cases from it
        are closed on arrival, never reviewed, and generate no notifications.
      schema:
        type: string
        minLength: 16
        maxLength: 64
      example: 5DAZHyr2QplqXFJsY4FzyaaSiTtxnd1lCrp57Y5boU8

  responses:
    UnknownChannel:
      description: |
        The channel does not exist or has been revoked. Deliberately `404` rather than
        `403` — not distinguishing the two is one fact less for anyone guessing tokens.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Message"
          example:
            message: Unknown reporting channel.

    ValidationFailure:
      description: The request failed validation
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ValidationError"
          example:
            status: E_VALIDATION_FAILURE
            messages:
              - message: The description field must be at least 10 characters
                rule: minLength
                field: description
                meta:
                  min: 10

    TooManyRequests:
      description: |
        Rate limit exceeded. By default 5 requests per hour from one IP address and 60 per
        hour per channel; the manufacturer may change the former.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Message"
          example:
            message: Too many reports from this address. Please try again later.

  schemas:
    ReportRequest:
      type: object
      required: [entryType, title, description]
      properties:
        entryType:
          type: string
          enum: [vulnerability, incident]
          description: |
            `vulnerability` — a weakness in the product that could be exploited.
            `incident` — an event that has already compromised security.
        title:
          type: string
          minLength: 3
          maxLength: 255
          description: One sentence, e.g. "Buffer overflow in the Wi-Fi module".
        description:
          type: string
          minLength: 10
          maxLength: 20000
          description: |
            What happens, how to reproduce it and what the impact is. If you are reporting a
            known, already published vulnerability in a component (a library, say), give its
            CVE number here — there is no CVE field, because for new flaws the identifier is
            assigned by a CNA at the manufacturer's request.
        exploitationObserved:
          type: boolean
          default: false
          description: |
            Set this if you have indications that the vulnerability is being **actively
            exploited**. It is recorded as the reporter's observation; establishing that
            fact — which starts the 24-hour Article 14 clock — is the manufacturer's call.
        locale:
          type: string
          enum: [pl, en]
          default: en
          description: |
            Language of the report. Optional; defaults to `en`.

            It decides the language of the confirmation and outcome e-mails, and which
            language version of the status page the links in those e-mails point to. The
            forms published by the manufacturer send it themselves.
          example: en
        affectedProducts:
          type: array
          maxItems: 50
          description: |
            Products covered by the report — a controller, a module or an application. One
            vulnerability may affect a whole product family. The list may be empty: a
            researcher often does not know which exact model is affected.

            The first entry becomes the leading product of the case: the register lists and
            searches by its name and version.
          items:
            $ref: "#/components/schemas/AffectedProduct"
        reporterName:
          type: string
          maxLength: 160
          nullable: true
          description: Name or handle.
        reporterEmail:
          type: string
          format: email
          maxLength: 190
          nullable: true
          description: |
            Without an address the manufacturer cannot ask for details or report the
            outcome. Supplying it triggers a confirmation e-mail with the case number.
        reporterPhone:
          type: string
          maxLength: 60
          nullable: true
        reporterOrganization:
          type: string
          maxLength: 160
          nullable: true
        reporterKind:
          type: string
          nullable: true
          enum: [researcher, customer, installer, partner, employee, other]
        reporterContactConsent:
          type: boolean
          default: false
          description: |
            Consent to being contacted about this report. The confirmation is sent without
            it — that is a reply to the reporter's own action — but the message about the
            outcome requires consent.

    AffectedProduct:
      type: object
      description: |
        What a reporter can observe about a product: what it is called, and which software,
        model and hardware revision it is.

        The rest of the manufacturer's product card — product line, market, end of support,
        whether it is still sold — is the manufacturer's own assessment. Those values decide
        whether a case still carries obligations under Article 14, so they are set inside
        the register and are not accepted here.
      required: [productName]
      properties:
        productName:
          type: string
          minLength: 1
          maxLength: 160
        productVersion:
          type: string
          maxLength: 60
          nullable: true
          description: Software version, e.g. "3.4.1" or "< 3.5".
        productModel:
          type: string
          maxLength: 120
          nullable: true
        hardwareVersion:
          type: string
          maxLength: 60
          nullable: true

    ReportAccepted:
      type: object
      required: [reference, message]
      properties:
        reference:
          type: string
          nullable: true
          description: |
            Case number in the `CRA-<year>-<sequence>` format. Quote it in correspondence.
            `null` only in the `202` response.
          example: CRA-2026-014
        trackingToken:
          type: string
          nullable: true
          description: |
            Key for checking the case status. Issued **once** — it cannot be recovered or
            derived from the case number.
          example: 7fUFHfDd5RVXGMxTmQx2J-B0qPdcyqqlMPho3cqPFb0
        message:
          type: string

    ReportStatus:
      type: object
      required: [reference, title, state, submittedAt, updatedAt]
      properties:
        reference:
          type: string
          example: CRA-2026-014
        title:
          type: string
          description: The title supplied by the reporter.
        state:
          type: string
          enum: [received, in_review, closed, rejected]
          description: |
            `received` — the report has arrived and is awaiting triage.
            `in_review` — the team is investigating.
            `closed` — the case has been closed.
            `rejected` — the report was assessed and declined.

            The register's internal states are finer grained; they are collapsed into four
            here, because the team's stage of work is not public information.
        submittedAt:
          type: string
          format: date-time
          description: When the report arrived.
        updatedAt:
          type: string
          format: date-time
          description: Last change to the case.

    Message:
      type: object
      required: [message]
      properties:
        message:
          type: string

    ValidationError:
      type: object
      required: [status, messages]
      description: Validation error envelope returned by the API for the `/v1` and `/v2` routes.
      properties:
        status:
          type: string
          enum: [E_VALIDATION_FAILURE]
        messages:
          type: array
          items:
            type: object
            required: [message, field]
            properties:
              message:
                type: string
              rule:
                type: string
                description: Name of the rule that failed, e.g. `minLength`, `enum`, `email`.
              field:
                type: string
                description: |
                  Path to the field. Nested fields take the form
                  `affectedProducts.0.productName`.
              meta:
                type: object
                additionalProperties: true
                description: "Rule parameters, e.g. { min: 10 }."
