hardening: prepared statements, PHP 7.4 idioms, and security fixes - #90
Open
somethingwithproof wants to merge 5 commits into
Open
somethingwithproof wants to merge 5 commits into
somethingwithproof wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to harden MikroTik/Cacti plugin code by modernizing PHP 7.4+ idioms and reducing injection risk in request handling and SQL operations.
Changes:
- Replaced
isset(...) ? ... : ...patterns with??in multiple parsing/collection paths. - Hardened request deserialization by restricting
unserialize()to disallow classes and defaulting invalid input to an empty array. - Switched a
DELETE ... IN (...)query to use a prepared statement with dynamic placeholders.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
RouterOS/routeros_api.class.php |
Uses null coalescing for parsed response values to simplify defaults. |
poller_mikrotik.php |
Replaces isset ternaries with ?? for multiple RouterOS response fields. |
mikrotik_users.php |
Hardens unserialize() usage and parameterizes a bulk delete query using placeholders. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
somethingwithproof
force-pushed
the
hardening/comprehensive
branch
from
April 9, 2026 09:00
d064f17 to
a1d3d9b
Compare
This was referenced Apr 11, 2026
somethingwithproof
added a commit
to somethingwithproof/plugin_mikrotik
that referenced
this pull request
Jul 29, 2026
No workflow file existed on this branch, so pull_request CI never triggered (checks showed as NONE). Copy the workflow already proven on PR Cacti#90 so this branch gets real CI signal. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
somethingwithproof
added a commit
to somethingwithproof/plugin_mikrotik
that referenced
this pull request
Jul 29, 2026
No workflow file existed on this branch, so pull_request CI never triggered (checks showed as NONE). Copy the workflow already proven on PR Cacti#90 so this branch gets real CI signal. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
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 29, 2026 05:37
996ee1b to
fd14578
Compare
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
xmacan
approved these changes
Sep 15, 2026
TheWitness
pushed a commit
that referenced
this pull request
Sep 18, 2026
* chore: add enterprise Dependabot configuration * chore: standardize enterprise Dependabot configuration * ci: add plugin integration test workflow No workflow file existed on this branch, so pull_request CI never triggered (checks showed as NONE). Copy the workflow already proven on PR #90 so this branch gets real CI signal. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * chore: keep Dependabot PR scoped Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
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.
Hardens and modernizes Mikrotik for PHP 7.4+.
Validation: