You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sync net-new v2.1.3 guards, instatic cleanup, Bun canary, and tags to dev - #361
Ports the net-new changes that shipped in v2.1.3 (e8d010d4 on release/2.1, PR #360) onto dev while keeping all 2.2 code, docs, and dependencies intact.
Changes
System Tweaks guards:
addons/system-tweaks/file-manager-guard.php: allowlist non-backend /file-manager page paths, reject JS/HTML metacharacters and control bytes in both raw and urldecode()REQUEST_URI, and validate HTTP_HOST.
addons/system-tweaks/vhost-guard.php: fail-closed cross-site database-user edit guard on /site/<domain>/database/user/edit/<user> (302 /login for unauthenticated, empty, or pre-login sessions; 403 for unreadable, pending-2FA, missing, or mismatched-owner sessions; PHP 8.1/8.4/8.5-safe OPEN_READONLY SQLite options), plus site log viewer route validation on /site/<domain>/log-file-content and /site/<domain>/load-logfiles (GET/HEAD/POST only, service in nginx/php, strict logFile filename without trim()).
addons/system-tweaks/pool-guard.ts: use a callback replacer () => ... in withPanelSession.
Updated tests/integration/integration-file-manager-guard.ts, tests/integration/integration-vhost-guard.ts, tests/test-system-tweaks.test.ts, SECURITY.md (including the top [!NOTE] on upstream CloudPanel coordination), docs/system-tweaks.md, and docs/decisions/system-tweaks.md.
Instatic temp-file cleanup: unlink .tmp files inside catch in both writeEnvFile and publishSnapshot in addons/instatic/action.ts, and add the failed-publication cleanup test in tests/test-action-instatic.test.ts.
Toolchain: bump pinned Bun canary to 1.4.5-canary.20261202.1 and bun-types to 1.4.5-canary.20261202T141441 with exact x64/arm64 npm sha512 integrities in package.json, bun.lock, .github/actions/install-bun/action.yml, README.md, and docs/decisions/releases.md.
changed version tags: re-tag the two backported entries in addons/stager/addon.ts and addons/git/addon.ts from 2.2.0 to 2.1.3, keeping both lists newest-first.
Verification
bun install --frozen-lockfile
bun run typecheck (0 errors in 477 files)
NO_COLOR=1 TMPDIR=/tmp bun run test (2703 pass, 0 fail across 133 files)
bun run build
bun tests/integration/integration-vhost-guard.ts (PHP 8.1, 8.4, 8.5: 139/139 passed)
bun tests/integration/integration-file-manager-guard.ts (PHP 8.1, 8.4, 8.5: 127/127 passed)
Summary by CodeRabbit
Security
Strengthened safeguards for File Manager requests, including checks for unexpected paths and malformed host information.
Added protections for database-user edits and site log requests, including ownership and input validation checks.
Bug Fixes
Temporary files are now cleaned up when environment-file writing or snapshot publishing fails.
Fixed session code insertion so its contents are preserved literally.
No actionable comments were generated in the recent review.
Walkthrough
This pull request adds request checks to System Tweaks guards, adds temporary-file cleanup to Instatic, updates the pinned Bun canary, and corrects two addon changelog version attributions.
The vhost guard checks session state and database-user ownership for edit requests. It restricts methods and parameters on site log routes and uses read-only SQLite options. Integration cases and documentation cover the checks.
The guard rejects disallowed page paths, unsafe request characters, and malformed nonempty Host headers. Integration cases and documentation describe the checks. Tests also assert that the guard scripts do not contain panel-session.php.
The pool guard now passes inlined panel session code to String.replace through a callback.
Instatic temporary-file cleanup
Layer / File(s)
Summary
Cleanup after write and publish failures addons/instatic/action.ts, tests/test-action-instatic.test.ts
The environment-file and snapshot publication paths remove temporary files when operations fail, then rethrow the error. A test checks that failed snapshot publication leaves no temporary archive.
Bun toolchain pin
Layer / File(s)
Summary
Update the pinned Bun version .github/actions/install-bun/action.yml, package.json, README.md, docs/decisions/releases.md
The install action uses Bun 1.4.5-canary.20261202.1 with updated x64 and ARM64 integrity values. Package metadata and documentation use the updated canary version.
Addon changelog version corrections
Layer / File(s)
Summary
Correct changelog version attribution addons/git/addon.ts, addons/stager/addon.ts
The Git Deploy authentication note and the Stager file-read restriction note move from version 2.2.0 to 2.1.3.
sequenceDiagram
participant Request
participant VhostGuard as vhost-guard.php
participant SessionReader as Shared session reader
participant SQLite
participant EditRoute as editDatabaseUser
Request->>VhostGuard: Request database-user edit
VhostGuard->>SessionReader: Read session
SessionReader-->>VhostGuard: Session attributes and status
VhostGuard->>SQLite: Query database-user owner
SQLite-->>VhostGuard: Owning site
VhostGuard->>EditRoute: Continue when the owner matches the requested domain
VhostGuard-->>Request: Redirect to /login or refuse invalid access
Loading
Possibly related PRs
7heMech/cloudpanel-addons#314: This PR updates the same Bun toolchain pins and install-action integrity values to the previous canary version.
Merge Risk: Minimal · up to 3ad71 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names several changes: guard updates, instatic cleanup, Bun canary bump, and changelog tag moves. The raw summary and objectives cover all of these. The title is long and lists many items, s…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names several changes: guard updates, instatic cleanup, Bun canary bump, and changelog tag moves. The raw summary and objectives cover all of these. The title is long and lists many items, so it is broad. It still refers to real parts of the changeset, and the main change (syncing net-new v2.1.3 guards to dev) is present. The title is therefore related to the changeset, but it lists several items instead of one primary change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the net-new changes that shipped in
v2.1.3(e8d010d4onrelease/2.1, PR #360) ontodevwhile keeping all2.2code, docs, and dependencies intact.Changes
addons/system-tweaks/file-manager-guard.php: allowlist non-backend/file-managerpage paths, reject JS/HTML metacharacters and control bytes in both raw andurldecode()REQUEST_URI, and validateHTTP_HOST.addons/system-tweaks/vhost-guard.php: fail-closed cross-site database-user edit guard on/site/<domain>/database/user/edit/<user>(302/loginfor unauthenticated, empty, or pre-login sessions; 403 for unreadable, pending-2FA, missing, or mismatched-owner sessions; PHP 8.1/8.4/8.5-safeOPEN_READONLYSQLite options), plus site log viewer route validation on/site/<domain>/log-file-contentand/site/<domain>/load-logfiles(GET/HEAD/POSTonly,serviceinnginx/php, strictlogFilefilename withouttrim()).addons/system-tweaks/pool-guard.ts: use a callback replacer() => ...inwithPanelSession.tests/integration/integration-file-manager-guard.ts,tests/integration/integration-vhost-guard.ts,tests/test-system-tweaks.test.ts,SECURITY.md(including the top[!NOTE]on upstream CloudPanel coordination),docs/system-tweaks.md, anddocs/decisions/system-tweaks.md..tmpfiles insidecatchin bothwriteEnvFileandpublishSnapshotinaddons/instatic/action.ts, and add the failed-publication cleanup test intests/test-action-instatic.test.ts.1.4.5-canary.20261202.1andbun-typesto1.4.5-canary.20261202T141441with exact x64/arm64 npm sha512 integrities inpackage.json,bun.lock,.github/actions/install-bun/action.yml,README.md, anddocs/decisions/releases.md.changedversion tags: re-tag the two backported entries inaddons/stager/addon.tsandaddons/git/addon.tsfrom2.2.0to2.1.3, keeping both lists newest-first.Verification
bun install --frozen-lockfilebun run typecheck(0 errors in 477 files)NO_COLOR=1 TMPDIR=/tmp bun run test(2703 pass, 0 fail across 133 files)bun run buildbun tests/integration/integration-vhost-guard.ts(PHP 8.1, 8.4, 8.5: 139/139 passed)bun tests/integration/integration-file-manager-guard.ts(PHP 8.1, 8.4, 8.5: 127/127 passed)Summary by CodeRabbit