Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(UI: Fix status chart filters #6975

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Thebarda
Copy link
Contributor

Description

This fixes status chart filters and aligns host group filter on RS endpoint.

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

Target serie

  • 22.10.x
  • 23.04.x
  • 23.10.x
  • 24.04.x
  • 24.10.x
  • master

How this pull request can be tested ?

Please describe the procedure to verify that the goal of the PR is matched. Provide clear instructions so that it can be correctly tested.

Any relevant details of the configuration to perform the test should be added.

Checklist

Community contributors & Centreon team

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (master, maintenance).

@Thebarda Thebarda marked this pull request as ready for review March 19, 2025 08:39
@Thebarda Thebarda requested a review from a team as a code owner March 19, 2025 08:39
Copy link
Contributor

coderabbitai bot commented Mar 19, 2025

📝 Walkthrough

Walkthrough

The changes update the widget components to incorporate a new resources property. In the Chart component, the resources prop is passed to the Legend component in both PieChart and BarStack renderings. The Legend component’s props interface is updated to include the resources array, which is then forwarded to the TooltipContent. Additionally, the Tooltip component’s props interface no longer includes the title property. Changes in the dashboard saving hook and the resource formatting utility remove intermediary filtering logic, simplifying the handling of resource data.

Changes

File(s) Change Summary
.../Chart/Chart.tsx
.../Legend/Legend.tsx
Added the resources prop: Chart now passes resources to Legend, and Legend’s interface was updated to include resources (an array of Resource), passing it to TooltipContent.
.../Tooltip/Tooltip.tsx Removed the title property from the component’s Props interface, necessitating adjustments to any logic relying on it.
.../hooks/useSaveDashboard.ts
.../utils.ts
Simplified resource handling: Removed the intermediary formattedResources in the dashboard saving logic and eliminated filtering parameters from the getFormattedResources utility for a direct data assignment.
.../Widgets/centreon-widget-statusgrid/src/StatusGridCondensed/Tooltip/useLoadResources.tsx
.../Widgets/centreon-widget-statusgrid/src/api/endpoints.ts
.../hooks/useLinkToResourceStatus.ts
Removed calls to getFormattedResources, now directly using the resources array in various functions for data handling.

Sequence Diagram(s)

sequenceDiagram
    participant Chart
    participant Legend
    participant TooltipContent

    Chart->>Legend: Render Legend with {..., resources}
    Legend->>TooltipContent: Pass resources via props
Loading

Possibly related PRs

Suggested labels

area/backend

Suggested reviewers

  • Yassir-BenBOUBKER
  • Noha-ElAbrouki
  • quborg
  • dmyios

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

📜 Recent review details

Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfa3cfd and bbdf760.

📒 Files selected for processing (5)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/StatusGridCondensed/Tooltip/useLoadResources.tsx (1 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/api/endpoints.ts (3 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks/useLinkToResourceStatus.ts (1 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks/useSaveDashboard.ts (1 hunks)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/utils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/utils.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks/useSaveDashboard.ts
🧰 Additional context used
🧬 Code Definitions (1)
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks/useLinkToResourceStatus.ts (1)
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/utils.ts (1) (1)
  • getUrlForResourcesOnlyWidgets (140-216)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: veracode-analysis / Run a pipeline scan
  • GitHub Check: frontend-web-lint
  • GitHub Check: frontend-unit-test
  • GitHub Check: frontend-web-build
  • GitHub Check: check-status
🔇 Additional comments (7)
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/StatusGridCondensed/Tooltip/useLoadResources.tsx (1)

49-49: Simplified resource handling by removing unnecessary formatting

The code now directly maps over the original resources array instead of passing it through an intermediate formatting function. This change aligns with the PR objective to fix status chart filters by streamlining the resource handling process.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/api/endpoints.ts (3)

70-72: Improved resource filtering logic

The code now directly filters the resources array to extract custom parameters, which simplifies the data flow and reduces unnecessary transformations. This change helps address the PR objective of ensuring proper alignment of filters with endpoints.


106-108: Streamlined search parameter handling

Similar to the custom parameters, the search parameters are now directly filtered from the resources array. This consistent approach helps maintain a cleaner codebase and more predictable behavior across different filtering scenarios.


180-189: Simplified resource transformation in condensed view

The direct mapping of resources in the buildCondensedViewEndpoint function maintains the same logic but eliminates unnecessary intermediate steps. This change is consistent with the other modifications and supports the PR goal of fixing status chart filters.

centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks/useLinkToResourceStatus.ts (3)

43-43: Streamlined resource type extraction

The code now uses a simpler approach by directly extracting resource types with pluck instead of using an intermediate formatting function. This simplification aligns with the other changes in this PR.


47-47: Direct access to business activity resources

The code now directly accesses the business activity ID from the resources array instead of using a formatted version. This change maintains the same functionality while simplifying the code path.


54-55: Consistent resource handling in URL generation

The getUrlForResourcesOnlyWidgets function now receives the original resources array directly, which aligns with how resources are handled elsewhere in the codebase after this PR's changes. This consistency helps ensure that filters are properly aligned across different components.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link



Scan Summary:
PIPELINE_SCAN_VERSION: 25.2.0-0
DEV-STAGE: DEVELOPMENT
SCAN_ID: 641f3b44-460b-4ded-b122-b285d0310107
SCAN_STATUS: SUCCESS
SCAN_MESSAGE: Scan successful. Results size: 928447 bytes
====================
Analysis Successful.
====================

==========================
Found 2 Scannable modules.
==========================
JS files within centreon-web-d0991a1815433bcab0d12add4cc0b58a68aa0133-13942237490-veracode-binary.zip
PHP files within centreon-web-d0991a1815433bcab0d12add4cc0b58a68aa0133-13942237490-veracode-binary.zip

===================
Analyzed 2 modules.
===================
JS files within centreon-web-d0991a1815433bcab0d12add4cc0b58a68aa0133-13942237490-veracode-binary.zip
PHP files within centreon-web-d0991a1815433bcab0d12add4cc0b58a68aa0133-13942237490-veracode-binary.zip

====================
Analyzed 428 issues.
====================

Total flaws found: 428, New flaws found: 0 as compared to baseline


==================================
SUCCESS: No issues passed filters.
==================================

@github-actions github-actions bot added skip-workflow-web skip workflow web and removed skip-workflow-web-analysis skip-workflow-web skip workflow web labels Mar 19, 2025
Copy link



Scan Summary:
PIPELINE_SCAN_VERSION: 25.2.0-0
DEV-STAGE: DEVELOPMENT
SCAN_ID: ed4af7dd-51f5-4315-a790-f8d019916020
SCAN_STATUS: SUCCESS
SCAN_MESSAGE: Scan successful. Results size: 928447 bytes
====================
Analysis Successful.
====================

==========================
Found 2 Scannable modules.
==========================
JS files within centreon-web-505acadb640b266d70c609f435813d3e3fa241f4-13943414814-veracode-binary.zip
PHP files within centreon-web-505acadb640b266d70c609f435813d3e3fa241f4-13943414814-veracode-binary.zip

===================
Analyzed 2 modules.
===================
JS files within centreon-web-505acadb640b266d70c609f435813d3e3fa241f4-13943414814-veracode-binary.zip
PHP files within centreon-web-505acadb640b266d70c609f435813d3e3fa241f4-13943414814-veracode-binary.zip

====================
Analyzed 428 issues.
====================

Total flaws found: 428, New flaws found: 0 as compared to baseline


==================================
SUCCESS: No issues passed filters.
==================================

Copy link

Code coverage report for centreon centreon 🚀

Coverage after merging MON-161732-status-chart-widget into develop will be
92.62%
Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard
   utils.ts82.72%50%93.33%93.48%188, 190, 61, 71, 79, 79, 79, 83, 86, 86, 86, 94, 99
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statuschart/src/Chart
   Chart.tsx72.92%80%57.14%71.43%113, 143, 61, 63, 70–71, 78–79, 82, 82
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statuschart/src/Legend
   Legend.tsx100%100%100%100%
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statuschart/src/Tooltip
   Tooltip.tsx93.75%85.71%100%100%65
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/StatusGridCondensed/Tooltip
   useLoadResources.tsx94.12%91.67%100%94.12%50, 59
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/Widgets/centreon-widget-statusgrid/src/api
   endpoints.ts84.55%70.37%100%97.56%131, 134, 152, 162, 181, 188, 205, 227, 229–230, 233, 243, 264, 75–76, 79, 82
centreon/www/front_src/src/Dashboards/SingleInstancePage/Dashboard/hooks
   useLinkToResourceStatus.ts74.42%75%83.33%72.73%100, 100, 100–101, 103, 106, 106, 106–107, 109, 112, 112, 112–113, 115, 36–37, 96, 96, 96–97
   useSaveDashboard.ts94.92%70%100%100%38–39, 44

@github-actions github-actions bot added the skip-workflow-web skip workflow web label Mar 19, 2025
Copy link



Scan Summary:
PIPELINE_SCAN_VERSION: 25.2.0-0
DEV-STAGE: DEVELOPMENT
SCAN_ID: ecff507f-386b-415a-8625-d193098f2034
SCAN_STATUS: SUCCESS
SCAN_MESSAGE: Scan successful. Results size: 931066 bytes
====================
Analysis Successful.
====================

==========================
Found 2 Scannable modules.
==========================
JS files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip
PHP files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip

===================
Analyzed 2 modules.
===================
JS files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip
PHP files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip

====================
Analyzed 429 issues.
====================

details


-------------------------------------
Found 1 issues of Very High severity.
-------------------------------------
CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'): www/include/common/javascript/Timeline/src/main/webapp/api/scripts/timeline.js:134
Details: This call to eval() contains untrusted input or potentially untrusted data. If this input could be modified by an attacker, arbitrary JS code could be executed. Validate all untrusted and untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. In general, avoid executing code derived from untrusted input. References: CWE
https://downloads.veracode.com/securityscan/cwe/v4/java/95.html
---------------------------------
Found 43 issues of High severity.
---------------------------------
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/reporting/dashboard/db-func.php:471
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/servicesservicegroups/xml/servicesummarybysgxml.php:169
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/servicesservicegroups/xml/servicesummarybysgxml.php:267
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query2. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/servicesservicegroups/xml/servicegridbysgxml.php:171
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/servicesservicegroups/xml/servicegridbysgxml.php:248
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query2. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/serviceshostgroups/xml/servicegridbyhgxml.php:173
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq1. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/services/xml/servicesummaryxml.php:157
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq1. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/services/xml/servicegridxml.php:175
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/hosts/xml/hostxml.php:260
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq1. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/monitoring/status/hostgroups/xml/hostgroupxml.php:140
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq1. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configobject/service/listservicebyhostgroup.php:237
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configobject/host/db-func.php:139
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configobject/host/db-func.php:1101
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configobject/contact/db-func.php:667
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable rq. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configknowledge/display-servicetemplates.php:114
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configknowledge/display-services.php:202
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configknowledge/display-hosttemplates.php:111
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configknowledge/display-hosts.php:137
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/configuration/configgenerate/xml/movefiles.php:146
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/vault-functions.php:1525
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request, data from a backend database. The data from the incoming HTTP request, data from a backend database originated from an earlier call to PDOStatement.fetchColumn. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/common-func.php:1815
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request, data from a backend database from the variable query. The data from the incoming HTTP request, data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/common-func.php:1858
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request, data from a backend database from the variable query. The data from the incoming HTTP request, data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/common-func.php:1892
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from a backend database from the variable query. The data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/common-func.php:1992
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request, data from a backend database from the variable query. The data from the incoming HTTP request, data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/common/common-func.php:2021
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from a backend database from the variable query. The data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/include/administration/performance/viewmetrics.php:73
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.query() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to query() contains data from the incoming HTTP request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreontraps.class.php:137
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreontraps.class.php:613
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreonldapadmin.class.php:616
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreonldap.class.php:193
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable queryLdapHostParameters. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreondowntime.class.php:1094
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/class/centreondb.class.php:341
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion'): www/api/class/webservice.class.php:348
Details: This call to !operator_phprequire() contains a PHP file inclusion flaw. The PHP application receives untrusted input but does not properly restrict the input before using it in require(), include(), or similar functions. This can allow an attacker to specify a URL to a remote location from which the application will retrieve code and execute it. The first argument to !operator_phprequire() contains data from the incoming HTTP request from the variable webService. Validate all untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. Use allowlists to specify known safe values rather than relying on blocklists to detect malicious input. References: CWE
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion'): www/api/class/centreon_realtime_base.class.php:88
Details: This call to !operator_phprequire() contains a PHP file inclusion flaw. The PHP application receives untrusted input but does not properly restrict the input before using it in require(), include(), or similar functions. This can allow an attacker to specify a URL to a remote location from which the application will retrieve code and execute it. The first argument to !operator_phprequire() contains data from the incoming HTTP request from the variable targetedFile. Validate all untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. Use allowlists to specify known safe values rather than relying on blocklists to detect malicious input. References: CWE
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/api/class/centreon_realtime_base.class.php:204
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable queryValuesRetrieval. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-98: Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion'): www/api/class/centreon_configuration_objects.class.php:84
Details: This call to !operator_phprequire() contains a PHP file inclusion flaw. The PHP application receives untrusted input but does not properly restrict the input before using it in require(), include(), or similar functions. This can allow an attacker to specify a URL to a remote location from which the application will retrieve code and execute it. The first argument to !operator_phprequire() contains data from the incoming HTTP request from the variable targetedFile. Validate all untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. Use allowlists to specify known safe values rather than relying on blocklists to detect malicious input. References: CWE
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/api/class/centreon_configuration_objects.class.php:223
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable queryValuesRetrieval. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): www/api/class/centreon_configuration_host.class.php:144
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): src/core/platform/infrastructure/repository/dbwriteupdaterepository.php:319
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.query() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to query() contains data arriving over the network from the variable query. The data arriving over the network originated from an earlier call to fgets. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): src/centreon/infrastructure/centreonlegacydb/centreondbadapter.php:107
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from the incoming HTTP request from the variable query. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): src/centreon/infrastructure/centreonlegacydb/centreondbadapter.php:167
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from a backend database from the variable sql. The data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): cron/centacl-func.php:639
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from a backend database from the variable request. The data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'): cron/centacl-func.php:674
Details: This database query contains a SQL injection flaw. The call to !php_standard_ns.PDO.prepare() constructs a dynamic SQL query using a variable derived from untrusted input. An attacker could exploit this flaw to execute arbitrary SQL queries against the database. The first argument to prepare() contains data from a backend database from the variable request. The data from a backend database originated from an earlier call to PDOStatement.fetchAll. Avoid dynamically constructing SQL queries. Instead, use parameterized prepared statements to prevent the database from interpreting the contents of bind variables as part of the query. Always validate untrusted input to ensure that it conforms to the expected format, using centralized data validation routines when possible. References: CWE OWASP
---------------------------------------
Skipping 241 issues of Medium severity.
---------------------------------------
------------------------------------
Skipping 108 issues of Low severity.
------------------------------------
---------------------------------------------
Skipping 36 issues of Informational severity.
---------------------------------------------

Total flaws found: 429, New flaws found: 44 as compared to baseline


=========================
FAILURE: Found 44 issues!
=========================

Copy link



[20 Mar 2025 12:56:48,0476] PIPELINE-SCAN INFO: Pipeline Scan Tool Version 25.2.0-0.
[20 Mar 2025 12:56:48,0559] PIPELINE-SCAN INFO: Scanning region: 'EU'.
[20 Mar 2025 12:56:48,0560] PIPELINE-SCAN INFO: Beginning scanning of 'centreon/centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip'.
[20 Mar 2025 12:56:48,0560] PIPELINE-SCAN INFO: Sending 64118629 bytes to the server for analysis.
[20 Mar 2025 12:57:14,0438] PIPELINE-SCAN INFO: Upload complete.
[20 Mar 2025 12:57:14,0438] PIPELINE-SCAN INFO: Scan ID: af2e9552-8f1b-4a38-88ee-1d1bf22e352d
[20 Mar 2025 12:57:14,0704] PIPELINE-SCAN INFO: Analysis Started.

===========================
Found 2 Scannable modules.
===========================
JS files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip
PHP files within centreon-web-abe0dcd4e844f1f0f87d1c0170a661a578811e2e-13944637572-veracode-binary.zip

[20 Mar 2025 13:31:54,0745] PIPELINE-SCAN INFO: Analysis Complete.
[20 Mar 2025 13:31:54,0747] PIPELINE-SCAN INFO: Analysis Results: Received 938864 bytes in 2106187ms.
[20 Mar 2025 13:31:54,0767] PIPELINE-SCAN INFO: Writing Raw JSON Results to file '/home/runner/_work/centreon/centreon/results.json'.
[20 Mar 2025 13:31:54,0784] PIPELINE-SCAN INFO: Writing Filtered JSON Results to file '/home/runner/_work/centreon/centreon/filtered_results.json'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy