Current release: vpsvip 0.4.0. Additional reliability and boundary fixes are
recorded in RELEASE-NOTES.txt and TEST-RESULTS.txt. The following detailed
security review was originally performed for rcpanel 0.3.1 and retained through
the vpsvippanel and vpsvip renames; its original review date is not a new audit
claim for this release.

rcpanel 0.3.1 - security review and hardening record
Date: 2026-11-09
Reviewed baseline: rcpanel 0.3.0

Historical record: rcpanel became vpsvippanel in 0.3.6 and vpsvip in 0.4.0.
The names and version-specific findings below describe the original review.
See DESIGN.txt for rename compatibility and TEST-RESULTS.txt for current tests.

ASSESSMENT

This pass found and fixed concrete trust, transaction-integrity, resource-use,
and service-lifecycle problems. The fixes are included in 0.3.1 with regression
tests. The application is better prepared for native acceptance testing; this
record is not an assertion that production deployment has been certified.

The available environment is Linux. No OpenBSD kernel, native service manager,
configuration validators, or native package transactions were run. Complete
OPENBSD-CHECKLIST.txt on a disposable OpenBSD 7.8 system before approving a
production rollout. TEST-RESULTS.txt records the final portable test count.

SCOPE AND THREAT MODEL

The review covered privileged process launch, editor handoff, service control,
configuration staging/review/validation/backup/replacement, package plans and
repository indexes, private settings/presets, installation, and terminal output.
Source inspection was paired with focused failure reproductions, regression
tests, actual harmless child processes, and real pseudo-terminal workflows.

The panel is a local administrative program. It exposes no listening network
service or remote-control API and never grants itself additional privileges.
An ordinary invocation uses that account's permissions. A root invocation can
change the server. The selected editor, explicitly invoked native programs,
service scripts, Python runtime, and installed packages remain trusted code.

Relevant hostile inputs include repository HTML, command output, discovered
names, inherited environment/path state, and unexpected filesystem objects.
Concurrent administrator changes and buggy foreground editors can also break
review assumptions even without an attacker. Private-file checks restrict
other accounts; they cannot sandbox another process already running as root.

FINDINGS AND FIXES

1. Inconsistent privileged execution and editor environment

   The configuration editor inherited the caller's complete environment and
   current directory. Bare EDITOR names used the inherited PATH. The general
   program browser had root executable trust checks that Runner and direct
   terminal handoff did not independently apply.

   On a privileged launch with unsafe inherited configuration, this could
   select another account's executable or expose an editor to inherited startup
   commands. This is conditional on that unsafe launch context; it is not a
   demonstrated remote takeover of an otherwise isolated OpenBSD installation.

   execution.py now supplies one shared boundary for Runner, editors, and
   foreground tools. It checks argv encoding, regular executable type, actual
   executable availability, and, for root, ownership and non-writability along
   every path component and symbolic-link target. Bare editor names resolve
   against a fixed system PATH. Relative executable paths are refused.

   The editor starts in / with the effective account's HOME/USER/LOGNAME, a
   checked terminal name, fixed PATH/C locale, closed inherited descriptors,
   and umask 077. Caller HOME, EXINIT/VIMINIT, shell startup hooks, loader/Python
   overrides, and arbitrary GUI variables are omitted. A nested EDITOR exported
   to a native program is checked and quoted as literal arguments.

   Custom editors still work when installed in a trusted location and kept in
   the foreground. An editor's own configuration under the effective account's
   home remains part of the administrator's trusted environment. Selecting a
   shell or interpreter with explicit arguments can intentionally execute code;
   these checks do not make such a command a sandbox.

   Evidence: test_execution.py, test_editor.py, test_native_ui.py,
   test_services.py, and the actual terminal editor-handoff test.

2. Writable sticky directories inside an installed application

   The installer treated any root-owned sticky directory as a safe exception
   to its writable-directory rule. That exception was intended for temporary
   ancestors, but also applied inside the installation tree. A sticky bit stops
   some removals; it does not stop another account adding new importable files.

   An installed import directory with mode 1777 could therefore be accepted
   even though another account could add code that a future privileged launch
   would import. This requires a misconfigured writable installation directory;
   the installer does not create application directories with that mode.

   Writable directories, including sticky ones, are now refused inside the
   chosen prefix. A root-owned sticky ancestor may be accepted only above a
   private prefix. Live installation also checks its recorded interpreter's
   trust before writing. Existing same-version module comparison and isolated
   launcher imports remain in effect.

   Evidence: test_installer.py rejects sticky prefix, version, package, and
   executable directories while retaining the current launcher. Its hostile
   cwd/PYTHONPATH test launches the installed application successfully.

3. Reviewed, validated, and installed configuration could diverge

   The UI displayed a diff, accepted confirmation, then commit reread the draft
   without binding it to that displayed version. A same-account process could
   change the draft while the confirmation was open.

   Separately, a private stage directory could be renamed and substituted at
   its pathname. A validator would then read the substitute while the pinned
   directory descriptor still selected the original installation candidate.
   A reproduction validated one string and installed different bytes.

   The installation copy could also change during backup work after its earlier
   validation check. A late replacement was reproduced before the fix. A FIFO
   substituted before the final metadata open could block the transaction.
   Cleanup could try removing a replacement directory or a preexisting stage
   name after a creation collision.

   These are transaction-integrity and local reliability issues involving
   access to the same account's private staging area. They do not establish
   an unprivileged remote write to a protected configuration file.

   ConfigReview now binds displayed text/diff to candidate bytes, file identity,
   metadata, and the originating transaction. The UI passes that exact review
   into commit. Changed drafts or replacement inodes require another review.
   Both standalone validation and installation validate a separate private copy.
   Parent and stage path identity/privacy are checked around validation; both
   the draft and installation copy are checked again after backup work.
   Nonblocking opens refuse FIFO substitution. Cleanup acts only on the pinned
   staging directory it actually opened.

   Evidence: test_config_security.py reproduces stage substitution, changes
   during validation/backup, foreign reviews, replacement inodes, and cleanup
   collisions. Its FIFO case runs in a bounded child process. test_tui.py
   changes a real staged file during confirmation and proves the live file is
   unchanged and the validator is not called.

4. Repository changes did not invalidate every package plan

   Catalog-selected installs carried repository provenance, but live-search
   installs, single-package updates, and update-all plans did not consistently
   bind to the configuration used during review. A concurrent administrator
   change to /etc/installurl could redirect a subsequent operation.

   Search results and every repository-dependent plan now retain the bounded,
   trusted installurl contents. The manager rechecks them after search, after
   preview, and before apply. A change requires a fresh search or preview.
   Package deletion remains possible without a working mirror.

   This closes a review-integrity gap. It does not freeze repository contents
   and was not a demonstrated package-signature bypass. Native signature and
   dependency checks remain enabled; no unsigned or force override was added.

   Evidence: test_packages.py covers changed configuration at each relevant
   stage, all network mutation modes, and repository-independent deletion.

5. A bounded download could still cause excessive HTML parser allocation

   The 16 MiB repository-index cap did not bound HTMLParser's attribute-list
   allocations for a single oversized tag. A controlled 4 MiB start-tag fixture
   exhausted a 128 MiB address-space limit before the fix. A hostile catalog
   response could therefore exhaust memory without installing any package.

   Indexes are now fed in small increments, with an 8 KiB bound on unfinished
   markup before a giant completed tag can expand into a large attribute list.
   Overall byte and package-count limits remain. Large valid listings and long
   ordinary text still parse within those limits.

   A separate Linux process tested the repaired parser with a 4,194,341-byte
   hostile input under a 128 MiB address-space limit. It returned PanelError in
   approximately 0.002 seconds with 20,824 KiB peak RSS. These are measurements
   from this environment, not cross-platform performance guarantees.

   Evidence: test_repository_catalog.py and the bounded-process reproduction.

6. Service deadlines and inherited output descriptors

   The panel imposed an outer kill deadline on service mutations and rcctl
   settings. A legitimate custom or slow service could outlast that deadline,
   despite native daemon_timeout configuration. The panel could interrupt a
   state-changing operation earlier than the service framework intended.

   Service mutations now have no panel kill timer. Native rc.d scripts govern
   completion; read/check/configtest operations remain bounded. The package
   writer policy remains unchanged. Deferred terminal signals still wait for
   an active panel-managed mutation to finish.

   Runner previously waited for pipe EOF even after its immediate command had
   exited. A descendant holding stdout could cause an indefinite wait, or a
   later timeout could kill a group containing the successfully started daemon.

   Runner now prepares and registers its output pipe before starting the child.
   After the immediate child exits it allows a 250 ms tail drain, preserves the
   native exit status, and marks output incomplete if another process still
   holds the pipe. It does not kill a process group merely because a completed
   command's output remained open. Incomplete previews cannot authorize writes.

   A later-writing descendant can receive SIGPIPE after the capture pipe closes;
   the result explicitly reports that possibility. Standard rc.subr actions
   redirect output unless debug mode is selected. A custom script that bypasses
   that behavior must redirect its daemon's output; the panel is not a daemon
   supervisor or a permanent log sink.

   Additional native correctness fixes accept valid leading-underscore service
   names and reject # in plain daemon flags before rc.conf comment handling can
   truncate them. Invalid command deadlines are refused before child launch.

   Evidence: service and streaming regressions use actual harmless descendants
   to verify prompt return and survival, check timeout-boundary behavior, and
   verify that monitor setup failure happens before a child is started.

7. Crash durability of installation and first saved settings

   Installer file contents were synced, but directory entries were not fully
   synced before exposing the new launcher. Newly created settings directories
   also lacked a parent-directory sync. A power loss could lose those links
   despite a completed save being reported.

   The installer now synchronizes new directory entries, version contents, and
   the version directory before switching the launcher. StateStore synchronizes
   each newly created directory's parent before the first file write. Existing
   atomic replacement and final-directory synchronization remain in place.
   Errors after replacement identify the file as already replaced or saved.

   These are durability fixes, not claims of unauthorized access. Fault-injected
   tests verify ordering and honest failure reporting; a real power-cut/storage
   failure test was not performed.

READABILITY

Executable policy is in one module instead of copied into multiple UI paths.
ConfigReview makes the approval contract explicit. Frozen named records replace
positional package-plan/search tuples. Process resources have a clear context
owner, and capture is separated from launch preparation. Comments explain trust
and failure boundaries. No unrelated feature expansion or wholesale UI rewrite
was included in this security release.

REMAINING DEPLOYMENT LIMITS

- Native OpenBSD acceptance is still required. Portable tests cannot establish
  daemon behavior, actual validator acceptance, package transactions, or the
  target system's Python/curses integration.
- Root can intentionally run destructive programs, edit policy, or install
  trusted package scripts. This panel is not a restricted administration shell.
- A same-privilege process can still race a final filesystem check and rename.
  Advisory locks coordinate panel instances, not every program on the server.
- A syntax check covers one staged file and its native interpretation at that
  moment. It does not snapshot includes, credentials, DNS, routes, or daemon
  runtime state. Successful validation does not prove a working deployment.
- A package preview is advisory. Other package clients and repository updates
  can change conditions; native package locking and checks remain authoritative.
- A custom service or package writer can hang. Without a panel kill timer,
  pending suspension/close waits for the native operation. An administrator
  must inspect the actual native process before deciding how to intervene.
- An unexpected monitoring or pipe-read failure after launch can still terminate
  a live command group. The no-timer policy is not a guarantee of uninterrupted
  mutation under every local I/O failure; inspect actual state after an error.
- An editor or foreground command has its normal authority and configuration.
  Shell/interpreter arguments, root startup files, and package/service scripts
  remain trusted administrative code.

PRIMARY REFERENCES

OpenBSD 7.8 manuals were checked for native command and service semantics:

https://man.openbsd.org/OpenBSD-7.8/rcctl.8
https://man.openbsd.org/OpenBSD-7.8/rc.d.8
https://man.openbsd.org/OpenBSD-7.8/rc.subr.8
https://man.openbsd.org/OpenBSD-7.8/rc.conf.8
https://man.openbsd.org/OpenBSD-7.8/vi.1
https://man.openbsd.org/OpenBSD-7.8/pkg_add.1
https://man.openbsd.org/OpenBSD-7.8/pkg_info.1
https://man.openbsd.org/OpenBSD-7.8/installurl.5
https://man.openbsd.org/OpenBSD-7.8/ftp.1
https://man.openbsd.org/OpenBSD-7.8/httpd.conf.5
https://man.openbsd.org/OpenBSD-7.8/smtpd.conf.5
https://man.openbsd.org/OpenBSD-7.8/rename.2
https://man.openbsd.org/OpenBSD-7.8/kqueue.2

Python process behavior and environment handling:

https://docs.python.org/3.10/library/subprocess.html
https://docs.python.org/3/library/html.parser.html
