Skip to content

[Security] Unauthenticated download of unpublished and expired documents via /unduhan/form-dokumen/unduh/{id} #1813

Done

Description

@langz337

Description

The public unduhan (downloads) route group exposes GET /unduhan/form-dokumen/unduh/{id} without authentication, and the downloadDokumen method in app/Http/Controllers/FrontEnd/DownloadController.php serves the file for the given ID without verifying that the document is published (is_published) or that it has not expired (expired_at):

public function downloadDokumen(FormDokumen $file)
{
    return response()->download($file->file_dokumen);
}

The public downloads list (getDataDokumen) filters correctly, so these documents are hidden from the list — but the download endpoint does not apply the same filter. Because document IDs are sequential, any unauthenticated user can iterate IDs and download internal/draft documents (is_published = 0) and expired documents (expired_at in the past).

Affected versions

OpenDK v2610.0.0 and prior versions. Verified still present in v2611.0.0 and on the main branch (HEAD 20147afc, 14 November 2026).

Steps to reproduce (local lab, OpenDK v2610.0.0)

  1. Create a document row with is_published = 0 and expired_at set in the past. Confirm it does not appear on the public downloads list.
  2. Send an unauthenticated request: GET /unduhan/form-dokumen/unduh/1
  3. Observed: HTTP 200 with the full file contents returned.

Impact

Information disclosure of unpublished (draft) and expired documents, which may contain internal or time-sensitive material.

Suggested fix

In downloadDokumen, apply the same visibility filter the public list uses before serving the file — only serve the document when is_published is true and (expired_at is null or in the future). Requests for hidden documents should return 404 so the endpoint does not confirm whether a given ID exists. The sibling endpoints in the same controller (downloadProsedur, downloadRegulasi) should be reviewed for the same pattern.

CVE

CVE-2026-128616 has been assigned by MITRE for this issue. I am holding public disclosure until a fixed release ships — please let me know once the fix is available so the writeup can be published in coordination.

Reported by Wisnandra Galang Revolusi Pambayun (Galang10).

Activity

  1. analisopendesa commented on Nov 25, 2026

    @analisopendesa
    Contributor

    Sudah diperbaiki di PR #1814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions