Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
c0112be
Exchange the passkey sign-in token with fetch, off the page's address
7heMech Nov 22, 2026
410fbbb
Git Deploy: let push-to-deploy through the panel's basic auth (#335)
7heMech Nov 25, 2026
0306656
Say dpkg has not finished, not that CloudPanel is being updated (#338)
7heMech Nov 25, 2026
a623f51
Print a dashboard URL the operator can open (#339)
7heMech Nov 25, 2026
71b61e5
Backport security audit fixes: Stager/Instatic no-follow, lock dirs, …
7heMech Dec 2, 2026
3b4e6c2
Backport root terminal TOTP autofill (#327)
7heMech Dec 2, 2026
9f8ba19
Backport requested release tag and prerelease checks (#355)
7heMech Dec 2, 2026
ec1c76f
Backport narrow-screen wrapping for table action buttons (#347)
7heMech Dec 2, 2026
20e4af1
Tag Git Deploy basic-auth note for 2.1.3
7heMech Dec 2, 2026
8f8d97d
Add lib/panel-custom-domain.ts helper for dashboard URL detection (#339)
7heMech Dec 2, 2026
57f2622
System Tweaks: block File Manager XSS and cross-site DB user edit IDOR
7heMech Dec 2, 2026
711d237
Toolchain: Bun canary 1.4.5-canary.20261201.1
7heMech Dec 2, 2026
2d9bf5e
Address PR #360 review findings on snapshot cleanup and panel guards
7heMech Dec 2, 2026
9a996de
System Tweaks: block log-file path traversal on site log routes
7heMech Dec 2, 2026
f68e7e8
Docs: note upstream coordination with CloudPanel at top of SECURITY.md
7heMech Dec 2, 2026
99aae85
Toolchain: Bun canary 1.4.5-canary.20261202.1
7heMech Dec 2, 2026
98f92f8
CI: run CodeQL from a workflow that skips tests/ (#337)
7heMech Dec 2, 2026
6d64c3f
Address Gemini 4 Neon review: log route methods, strict validation, d…
7heMech Dec 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/actions/install-bun/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ runs:
- name: Download and verify Bun
shell: bash
env:
BUN_VERSION: 1.4.5-canary.20261119.1
BUN_INTEGRITY_X64: sha512-vJbB1ztmmJNeETDB914osXj8hTCv63TRaILXtvFpXV9IQEjdWPYs2UhlHvSCqHtxSxFOJObG1PG+k1UvsDJmUA==
BUN_INTEGRITY_ARM64: sha512-+xgoAKU8y30Xjy6119Wgrr5WhfPsl/OY6QLZ/+BtxuBPlN7VZ+WoMbbUaXBKvxsMHrmz8V1hxZ7+MavBxrb5zg==
BUN_VERSION: 1.4.5-canary.20261202.1
BUN_INTEGRITY_X64: sha512-XzXrnTLW4j43nbKv5bAn9Wyq1lHl0yPV1filPvPotPJtAqb3WbGLw5VMH/af+Z1SFLwEbtTd/tmVC0CsKNe8eg==
BUN_INTEGRITY_ARM64: sha512-VVypKrvPqBzg/kZsOH0MF0dgdbrUPmtZCWQ6ep6piCrg4ZBdNm+RV8TfRWZvmiHNWd96E4DGR4i3bydS0TA7jA==
run: |
set -euo pipefail
pinned="$(jq -r .packageManager package.json)"
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# CodeQL code scanning.
#
# An advanced setup rather than GitHub's default one, because only this can
# leave out paths: tests/ builds HTML and checks hostnames with plain string
# matching on purpose, and every such line read as a security alert. The
# queries are the default suite, as before.

name: codeql

on:
pull_request:
push:
branches: [main]
schedule:
- cron: "27 4 * * 1"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [actions, javascript-typescript]
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
languages: ${{ matrix.language }}
build-mode: none
config: |
paths-ignore:
- tests

- name: Analyze
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4.39.5
with:
category: /language:${{ matrix.language }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Backups.

## Develop

Requires Bun 1.4.5-canary.20261119.1 (`npm install -g bun@1.4.5-canary.20261119.1`) and ShellCheck.
Requires Bun 1.4.5-canary.20261202.1 (`npm install -g bun@1.4.5-canary.20261202.1`) and ShellCheck.

```bash
bun install
Expand Down
19 changes: 16 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Security model and hardening

> [!NOTE]
> Please stop sending security reports to CloudPanel for issues that System
> Tweaks already mitigates. We are working directly with the CloudPanel team to
> get everything System Tweaks patches fixed upstream.

CloudPanel Addons limits which requests can reach root and adds protections to
CloudPanel. These controls address specific risks; they do not make the server
unhackable. Implementation details are in [Security decisions](docs/decisions/security.md).
Expand Down Expand Up @@ -61,11 +66,17 @@ and limits.

**Nginx config injection.** The guard validates new panel settings before
CloudPanel renders them into nginx config, addressing the
[CloudPanel 2.5.4-3 disclosure](https://seclists.org/fulldisclosure/2026/Oct/14).
[CloudPanel 2.5.4-3 disclosure](https://seclists.org/fulldisclosure/2026/Oct/14)
([cloudpanel-ce#829](https://github.com/cloudpanel-io/cloudpanel-ce/issues/829)).
Only active administrators can save raw Vhost and PageSpeed configuration,
which also closes
[CVE-2024-44765](https://nvd.nist.gov/vuln/detail/CVE-2024-44765), where a
non-admin account edited its vhost to serve the panel's own files.
non-admin account edited its vhost to serve the panel's own files. The same
panel guard also refuses cross-site edits on
`/site/<domain>/database/user/edit/<user>`, where CloudPanel looked up the
database user globally without checking that it belonged to `<domain>`, and
refuses path traversal or unknown services on the site log viewer routes
(`/site/<domain>/log-file-content` and `/site/<domain>/load-logfiles`).
[Guide](docs/system-tweaks.md#nginx-config-injection)

**The site's Varnish file.** A checked, root-owned include replaces the backend
Expand Down Expand Up @@ -115,7 +126,9 @@ phpMyAdmin from the panel is unchanged.
**File Manager paths.** CloudPanel's File Manager runs as root and followed `..`
and symbolic links out of the site's home, so a panel account could read, create
or take over files anywhere on the server, and extract device files and setuid
programs. A guard refuses such requests and archives, and only the panel's nginx
programs. A guard refuses such requests and archives, refuses unexpected page
paths and malformed `Host` headers on `/file-manager/` so its page cannot echo
script into its own inline JavaScript, and only the panel's nginx
can reach the File Manager's PHP. Every File Manager action that writes, deletes,
changes permissions or reads a file's contents runs as the site's own user, so a
link planted mid-request can only reach what that user could already reach.
Expand Down
8 changes: 2 additions & 6 deletions addons/cloudflare-ips/action.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { LOCK_DIR, addonStateDir, PANEL_DB, DISTRO_NGINX_SITES_DIR } from "../../lib/paths";
import { writeFileAtomic } from "../../lib/atomic-write";
import { Database } from "bun:sqlite";
import {
chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, rmSync,
} from "node:fs";
import { dirname, join } from "node:path";
import { existsSync, lstatSync, readFileSync, rmSync } from "node:fs";
import { join } from "node:path";
import { errorMessage } from "../../lib/errors";
import { replyToAction, failAction } from "../../lib/action";
import { runCommand, type CommandResult } from "../../lib/command";
Expand Down Expand Up @@ -262,8 +260,6 @@ function listState(paths: CloudflareActionPaths): { sites: CloudflareSiteView[];
}

async function withPolicyLock<T>(paths: CloudflareActionPaths, body: () => Promise<T>): Promise<T> {
mkdirSync(dirname(paths.lockFile), { recursive: true });
chmodSync(dirname(paths.lockFile), 0o700);
return withFileLock(paths.lockFile, 30, "another Cloudflare IP operation is running", body);
}

Expand Down
4 changes: 1 addition & 3 deletions addons/dns/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { withPanelDb } from "../../lib/panel-db";
import { DNS_VERBS } from "./verbs";
import { Database } from "bun:sqlite";
import { createHash, randomBytes } from "node:crypto";
import { existsSync, mkdirSync } from "node:fs";
import { dirname } from "node:path";
import { existsSync } from "node:fs";
import { ActionFailure, replyToAction, failAction, readJsonRequest } from "../../lib/action";
import { errorMessage } from "../../lib/errors";
import { nameSlug, oneLine } from "../../lib/validate";
Expand Down Expand Up @@ -1231,7 +1230,6 @@ export async function executeDnsAction(argv: string[], options: DnsActionOptions
}
if (verb === "site-status") return action.siteStatus(provision!.domain);

mkdirSync(dirname(paths.lockFile), { recursive: true, mode: 0o700 });
// Long enough for a check of the whole fleet; a page action waits less and says so.
const wait = verb === "reconcile" || verb === "sync-sites" || verb === "provision" ? 240 : 30;
return withFileLock(paths.lockFile, wait, "DNS is busy checking Cloudflare; try again in a moment", async () => {
Expand Down
3 changes: 3 additions & 0 deletions addons/git/addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const GIT_ADDON: AddonDefinition = {
name: "git",
title: "Git Deploy",
description: "Deploy a site from a Git remote and run a command afterwards.",
changed: [
{ in: "2.1.3", note: "The push-to-deploy URL now works when the panel has basic auth: basic auth no longer applies to that one route, whose token is its credential. The rest of the addon pages keep basic auth." },
],
targets: GIT_TARGETS,
handler: handle,
action: runGitAction,
Expand Down
Loading