security/openvpn-legacy: read-only user can stop a running VPN

Chiusa Adatta ai principianti
#5,887 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@fichtner ci sta già lavorando.

Dal 5/11/2026.

  • #5888 di @besendorf — integrata

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

Inizia leggendo /vpn_openvpn_server.php e /vpn_openvpn_client.php, concentrandoti sui percorsi POST di eliminazione e attivazione/disattivazione e sull’ordine di openvpn_delete() e write_config(). Riproduci il comportamento di negazione della scrittura per l’utente di sola lettura e verifica come lo gestisce ciascuna pagina. Il lavoro è completato quando le richieste POST di sola lettura non causano modifiche di runtime o alla configurazione e l’UI segnala il rifiuto invece del successo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

incomplete

Summary

os-openvpn-legacy permits a WebGUI user with the OpenVPN Servers page privilege and user-config-readonly to stop a running legacy OpenVPN server. The delete action calls openvpn_delete() before write_config(). The latter rejects the configuration write, but the runtime process has already been stopped. The client page has the same call order. Both pages also ignore the failed write when applying toggle actions.

Severity and affected versions

Proposed severity: Moderate (VPN availability impact requiring an authenticated user with the relevant page privilege).

Verified on OPNsense Community 26.7.8_2 with os-openvpn-legacy 1.0_2. The current plugin source at commit 7c8cc9544b9cbe36d428aece439565167b6841c5 contains the same paths. Earlier versions have not been tested; the last unaffected version is unknown. The affected GUI page is /vpn_openvpn_server.php; the analogous client page is /vpn_openvpn_client.php.

Reproduction and observed result

In an isolated VM, a disposable legacy OpenVPN server was running. A new non-root account had exactly page-openvpn-server, page-system-login-logout, and user-config-readonly. That account could access the legacy server page and sent a CSRF-valid act=del&id=0 POST. The page returned HTTP 200 and {"status":"ok"}. The server remained in the saved configuration, while /api/core/service/search changed from running: 1 to running: 0. The test server and account were removed afterward.

The client delete and both toggle paths are source-confirmed but were not separately reproduced.

Suggested fix

Reject POST requests from user-config-readonly users before any runtime or configuration changes in both legacy pages. Handle the denied write explicitly so the UI does not report a successful deletion.

AI assistance disclosure

OpenAI GPT-6 assisted with source review, drafting, and the local reproduction script. The behavior and disposable VM result were checked against OPNsense 26.7.8_2 and os-openvpn-legacy 1.0_2.

Lingua principale
PHP
Stelle
1.2k
Fork
905
Merge medio
4g 12h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opnsense/plugins

Tutte le issue di opnsense/plugins

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.