hardening: prepared statements, PHP 7.4 idioms, and security fixes#365
Merged
TheWitness merged 8 commits intoJul 21, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Hardening-focused update for the Intropage plugin, aiming to reduce injection risk and modernize some PHP idioms in panel and admin code paths.
Changes:
- Added explicit integer casting for SQL-concatenated numeric values (template IDs, LIMIT counts, ports).
- Replaced
isset()-based ternaries with??for defaulting values. - Introduced a prepared statement for
graph_tree_itemsparent lookups and used??=for session defaulting.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
panellib/busiest.php |
Casts interpolated numeric values used in SQL query construction (data_template_id, LIMIT). |
panellib/analyze.php |
Casts snmp_port in a host lookup query; uses a prepared statement for tree parent traversal. |
include/settings.php |
Uses null coalescing (??) for injecting default form variables and panel defaults. |
include/functions.php |
Uses null coalescing (??) for panel height defaults; uses ??= for session initialization. |
xmacan
approved these changes
Apr 9, 2026
xmacan
previously approved these changes
Apr 9, 2026
This was referenced Apr 11, 2026
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Add targeted tests for prepared statement migration, output escaping, auth guard presence, CSRF token validation, redirect safety, and PHP 7.4 compatibility. Tests use source-scan patterns that verify security invariants without requiring the Cacti database. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
force-pushed
the
hardening/comprehensive
branch
from
July 14, 2026 10:47
6e5fa70 to
8337113
Compare
TheWitness
approved these changes
Jul 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Consolidated hardening PR:
4 files changed, 35 insertions(+), 37 deletions(-)
All changes are mechanical transforms with zero behavioral impact. PHP 7.4+ compatible.