Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
d539aaf
feat(security): add cacti_exec shell execution gateway
somethingwithproof Apr 17, 2026
fdf4a43
fix(security): harden CLI SAPI check, CSP headers, and XML parsing
somethingwithproof Apr 17, 2026
d4dcab0
feat(security): add cacti_http SSRF-safe HTTP fetch gateway
somethingwithproof Apr 17, 2026
a03393c
fix(security): add LDAP filter injection prevention helper
somethingwithproof Apr 17, 2026
1edb247
feat(security): add request-layer helpers for sort, IDs, and LIKE
somethingwithproof Apr 17, 2026
6abba04
feat(security): add centralized action dispatcher with realm enforcement
somethingwithproof Apr 17, 2026
a6539f5
fix(security): escape description output in managers and html_form
somethingwithproof Apr 17, 2026
8ba1caa
feat(security): add auth transition helper for session fixation preve…
somethingwithproof Apr 17, 2026
bbd73b6
docs(security): add CSRF migration plan
somethingwithproof Apr 17, 2026
228c46d
ci(security): add PHPStan level 5 static analysis workflow
somethingwithproof Apr 17, 2026
a8c0ed3
test(security): add source-scan tests for security architecture items
somethingwithproof Apr 17, 2026
3001d75
feat(security): add cacti_safe_write for path-safe file imports
somethingwithproof Apr 17, 2026
00025dd
feat(security): add cacti_plugin_path for LFI-safe plugin includes
somethingwithproof Apr 17, 2026
59516a6
fix(security): migrate all plugin includes to cacti_plugin_path
somethingwithproof Apr 17, 2026
0f85a88
fix(security): remove legacy SHA-1 package verification path
somethingwithproof Apr 17, 2026
ca69cae
test(security): add safe_write, plugin_path, and SHA-256 tests
somethingwithproof Apr 17, 2026
3d1a9ee
fix(graph): short-circuit on invalid local_graph_id before array access
somethingwithproof Apr 16, 2026
cbdf2a5
test(graph): verify invalid local_graph_id short-circuit guard
somethingwithproof Apr 16, 2026
a7326fc
fix(admin): guard db_fetch_row results across admin UI and poller scr…
somethingwithproof Apr 16, 2026
9b49f97
test: verify all db_fetch_row results are guarded before dereference
somethingwithproof Apr 16, 2026
1918657
fix: redirect to HTTP_REFERER via validate_redirect_url on guard fail…
somethingwithproof Apr 17, 2026
edeb326
test(graph): update redirect assertion to match validate_redirect_url
somethingwithproof Apr 17, 2026
05c2134
fix(boost): reject cache_directory equal to base_path in purge loop
somethingwithproof Apr 17, 2026
0a9f7b3
fix(import): unlink tempnam file after package import
somethingwithproof Apr 17, 2026
f949bdf
refactor: extract cacti_path_is_within from duplicated path checks
somethingwithproof Apr 17, 2026
0ed2464
test: defense-in-depth followup coverage
somethingwithproof Apr 17, 2026
f4ca9a1
fix(csrf): broaden GET-state-change deny-list to cover plugin/automat…
somethingwithproof Apr 17, 2026
8580834
fix(csrf): harden csrf-magic cookie flags + hash_equals + logout doc
somethingwithproof Apr 17, 2026
3efbdcc
fix(ci): use specific runner labels, fix codeql concurrency
somethingwithproof Mar 16, 2026
4d7f179
Improve IPv6 support in RRDtool proxy and ping utilities (#2)
somethingwithproof Apr 13, 2026
1c5298d
fix(js): resolve 3 CodeQL error-severity findings (null deref + type …
somethingwithproof Apr 17, 2026
9aabdce
fix(ci): use specific runner labels, fix codeql concurrency
somethingwithproof Mar 16, 2026
2da219b
Improve IPv6 support in RRDtool proxy and ping utilities (#2)
somethingwithproof Apr 13, 2026
d2a482a
fix(js): escape DOM text before HTML insertion in layout.js
somethingwithproof Apr 17, 2026
5979504
fix(js): escape DOM text before HTML insertion in midwinter main.js
somethingwithproof Apr 17, 2026
eef9035
fix(import): block dangerous stream wrappers in package import paths
somethingwithproof Apr 17, 2026
a60b8d2
fix(db): sanitize column names in _db_replace to prevent SQL injection
somethingwithproof Apr 17, 2026
d24db44
feat(security): add Tier 1+2 helpers — path, redirect, fetch, redact,…
somethingwithproof Apr 17, 2026
6d75226
fix(security): parameterize RLIKE queries and validate graph_theme
somethingwithproof Apr 17, 2026
b4e2f3d
fix(security): parameterize 5 REGEXP sites in reports.php
somethingwithproof Apr 17, 2026
58e65e6
fix(security): forward-port GHSA fixes to develop — session fixation,…
somethingwithproof Apr 17, 2026
ca5663d
fix: escape apostrophe in automation_templates.php; move follow_locat…
somethingwithproof Apr 17, 2026
4e973d3
fix: add array type hints, cast stream_get_contents, remove redundant…
somethingwithproof Apr 17, 2026
41bdbef
fix: guard strlen(false) in import.php XML size check
somethingwithproof Apr 17, 2026
5f65009
fix: remove redundant isset on known-populated descriptor array offsets
somethingwithproof Apr 17, 2026
21da254
fix: escape remaining device apostrophes in automation_templates.php
somethingwithproof Apr 17, 2026
b8e1ae4
fix(i18n): clear invalid format strings in bg-BG, el-GR, fr-FR, he-IL…
somethingwithproof Apr 17, 2026
531f750
fix(style): apply php-cs-fixer formatting across all changed files
somethingwithproof Apr 17, 2026
c2904cd
fix(style): apply cs-fixer formatting to functions.php
somethingwithproof Apr 17, 2026
890a213
fix: restore functions.php from upstream, reapply TLS hardening and c…
somethingwithproof Apr 17, 2026
44e2bc7
fix(phpstan): regenerate baseline with 1050 pre-existing Level 6 errors
somethingwithproof Apr 17, 2026
a991b40
fix: restore rrd.php/auth_login/global from upstream, add security_va…
somethingwithproof Apr 17, 2026
48e763e
fix(style): apply cs-fixer formatting to functions.php after removing…
somethingwithproof Apr 17, 2026
2908b63
fix(phpstan): add baseline entries for Cannot use ++ on bool in api_a…
somethingwithproof Apr 17, 2026
e69a747
fix(i18n): revert po file changes to upstream to avoid msgcheck fuzzy…
somethingwithproof Apr 17, 2026
c3f01f1
fix(scripts): restore upstream U-on-error fixes for ss_webseer, ss_ge…
somethingwithproof Apr 18, 2026
3eed122
refactor: drop files covered by smaller PRs (#7036, #7040, #7057)
somethingwithproof Apr 18, 2026
7523bc2
feat(security): DOM XSS + JS hardening + unique consolidated fixes
somethingwithproof Apr 18, 2026
f5f0efa
Merge branch 'develop' into feat/security-consolidated-develop
TheWitness Apr 22, 2026
b0af8da
chore: ignore local Claude Code tooling state and add contributor notes
somethingwithproof Apr 23, 2026
0e446e5
chore: remove accidentally tracked .omc session and state files
somethingwithproof Apr 23, 2026
8a2e5e2
ci: use branch-specific PHP matrix for 1.2.x and develop
somethingwithproof Apr 23, 2026
132d561
security: add architectural proof pipeline and sink guardrails
somethingwithproof Apr 23, 2026
5ca63a0
security: prove architectural helper adoption and hotspot drift
somethingwithproof Apr 23, 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
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
47 changes: 47 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "CodeQL"

on:
push:
branches: [main, master, develop, regression-audit]
paths-ignore:
- "**/*.php"
- "**/*.md"
pull_request:
branches: [main, master, develop, regression-audit]
paths-ignore:
- "**/*.php"
- "**/*.md"
schedule:
- cron: "30 1 * * 1"
workflow_dispatch:

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

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["javascript-typescript", "python"]
steps:
Comment on lines +6 to +35
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This CodeQL workflow explicitly ignores all PHP files and does not analyze the PHP language (matrix only includes javascript-typescript and python). Given this repository is primarily PHP and this PR is security-focused, this configuration will miss the most important CodeQL coverage. Please enable PHP CodeQL analysis and remove the paths-ignore entries for **/*.php.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — PHP in CodeQL is a separate long-standing discussion (#5955 tracks it).

- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Initialize CodeQL
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3
with:
category: "/language:${{ matrix.language }}"
54 changes: 54 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# +-------------------------------------------------------------------------+
# | Copyright (C) 2004-2026 The Cacti Group |
# | |
# | This program is free software; you can redistribute it and/or |
# | modify it under the terms of the GNU General Public License |
# | as published by the Free Software Foundation; either version 2 |
# | of the License, or (at your option) any later version. |
# | |
# | This program is distributed in the hope that it will be useful, |
# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# | GNU General Public License for more details. |
# +-------------------------------------------------------------------------+
# | Cacti: The Complete RRDtool-based Graphing Solution |
# +-------------------------------------------------------------------------+
# | This code is designed, written, and maintained by the Cacti Group. See |
# | about.php and/or the AUTHORS file for specific developer information. |
# +-------------------------------------------------------------------------+
# | http://www.cacti.net/ |
# +-------------------------------------------------------------------------+

name: PHPStan Static Analysis

on:
push:
branches: [ 1.2.x ]
pull_request:
branches: [ 1.2.x ]

permissions:
contents: read

concurrency:
group: phpstan-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
phpstan:
runs-on: ubuntu-latest
name: PHPStan Level 5

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: ldap, xml, curl, mbstring
tools: phpstan

- name: Run PHPStan
run: phpstan analyse --configuration=phpstan.neon --no-progress
80 changes: 80 additions & 0 deletions .github/workflows/security-proof.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Security Proof Guardrails

on:
push:
branches: [develop, 1.2.x]
pull_request:
branches: [develop, 1.2.x]
workflow_dispatch:
inputs:
repo_name:
description: "Repository to query for advisory source data (owner/name)"
required: false
default: "Cacti/cacti"
branch_list:
description: "Space-separated branch list to evaluate"
required: false
default: "1.2.x develop"
strict_gate:
description: "Fail run when unresolved advisories remain"
required: false
default: "false"

permissions:
contents: read

concurrency:
group: security-proof-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
sink-inventory-guard:
name: sink and architectural hotspot guard
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify tracked sink baseline
run: scripts/security/verify_sink_inventory.sh

- name: Verify no new architectural hotspots
run: scripts/security/verify_architectural_hotspots.sh

advisory-proof-matrix:
name: private advisory proof matrix
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build proof matrix
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
out_dir="security/proof-run/${GITHUB_RUN_ID}"
mkdir -p "${out_dir}"
scripts/security/build_private_advisory_matrix.sh \
"${{ inputs.repo_name }}" \
"${{ inputs.branch_list }}" \
"${out_dir}"
scripts/security/build_sink_inventory.sh > "${out_dir}/sink_inventory.current.tsv"
scripts/security/build_architectural_helper_report.sh --summary > "${out_dir}/architectural_helper.summary.tsv"
scripts/security/build_architectural_helper_report.sh --hotspots > "${out_dir}/architectural_helper.hotspots.tsv"

- name: Enforce closure gate
if: inputs.strict_gate == 'true'
run: |
set -euo pipefail
scripts/security/verify_private_advisory_matrix.sh "security/proof-run/${GITHUB_RUN_ID}/private_advisory_proof_matrix.tsv"

- name: Upload proof artifacts
uses: actions/upload-artifact@v4
with:
name: private-advisory-proof-${{ github.run_id }}
path: security/proof-run/${{ github.run_id }}
if-no-files-found: error
6 changes: 3 additions & 3 deletions .github/workflows/syntax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ name: Cacti Commit Audit

on:
push:
branches: [ develop ]
branches: [ develop, 1.2.x ]
pull_request:
branches: [ develop ]
branches: [ develop, 1.2.x ]

permissions:
contents: read
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['8.1', '8.2', '8.3', '8.4']
php: ${{ fromJSON((github.base_ref == '1.2.x' || github.ref_name == '1.2.x') && '["7.4","8.0","8.1","8.2","8.3","8.4"]' || '["8.1","8.2","8.3","8.4"]') }}
experimental: [false]

services:
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ resource/**

# Ignore Cacti script files/folders
scripts/**
!scripts/security/
!scripts/security/*.sh

# Ignore Custom Cacti theme folders
include/themes/*/*
Expand Down Expand Up @@ -99,6 +101,12 @@ include/vendor/csrf/csrf-secret.php
# Ignore visual studio code
.vscode/**

# Ignore local developer tooling state (Claude Code, oh-my-claudecode, git worktrees, local notes)
.claude/
.omc/
.worktrees/
notepad.md

# Ignore vendor folders
include/vendor/**
vendor/**
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ repos:
hooks:
- id: lintcheck
name: PHP Lint Checking
entry: sh tests/tools/pre-commit-check.sh lint
entry: composer run-script lint
language: system
types: [php]
files: ^app/
always_run: true

- id: phpcsfixer
name: PHP CS Fixer Validation
entry: sh tests/tools/pre-commit-check.sh phpcsfixer
entry: composer run-script phpcsfixer
language: system
types: [php]
files: ^app/
always_run: true

- id: phpstan
name: PHPStan Validation
entry: sh tests/tools/pre-commit-check.sh phpstan
entry: composer run-script phpstan
language: system
types: [php]
files: ^app/
Comment on lines 4 to +22
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pre-commit hooks are restricted to files: ^app/, but this repository’s PHP sources are primarily at the repo root and in lib/, include/, etc. As a result, these checks won’t run on most changes. Please adjust the files: regex (or use types: [php]) so lint/phpcsfixer/phpstan run on the actual codebase paths.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — pre-commit config needs path scope updated to match PHP source layout.

always_run: true
1 change: 0 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Cacti CHANGELOG

1.3.0-dev
-issue#6762: Harden lib/ping.php: apply cacti_escapeshellarg() to hostname in native ping and fping shell commands
-issue#6760: Harden link.php: apply sanitize_uri() to HTTP_REFERER before redirect
-issue#6761: Harden auth_changepassword.php: apply sanitize_uri() to HTTP_REFERER in all redirect paths
-issue: Fix loose $db_conn comparison in db_table_exists and db_column_exists
-issue#6545: Add 30 and 60 second timeout options for Remote Agent and Poller settings
Expand Down
Loading
Loading