CTOR-2244 [apps::atlassian::statuspage] - new plugin#6073
CTOR-2244 [apps::atlassian::statuspage] - new plugin#6073garnier-quentin wants to merge 19 commits intocentreon:developfrom
Conversation
| foreach (@{$results->{components}}) { | ||
| next if (defined($self->{option_results}->{filter_component_id}) && $self->{option_results}->{filter_component_id} ne '' && | ||
| $_->{id} !~ /$self->{option_results}->{filter_component_id}/); | ||
| next if (defined($self->{option_results}->{filter_component_name}) && $self->{option_results}->{filter_component_name} ne '' && |
There was a problem hiding this comment.
User-supplied --filter-component-name is interpolated directly into a regex ( $_->{name} !~ /$self->{option_results}->{filter_component_name}/ ). Validate or escape the input before using it in a regex to avoid regex injection/DoS.
Details
✨ AI Reasoning
The code builds regular expressions directly from values that can be provided by users (CLI options). Direct interpolation into regex literals can allow crafted input to change matching behavior, cause runtime errors, or trigger catastrophic backtracking. The problematic expressions are used for filtering and are not sanitized or validated. This was introduced by the new component filtering logic that applies these option values directly into regex matches.
🔧 How do I fix it?
Use parameterized queries with placeholders, array-based command execution (no shell interpretation), or properly escaped arguments using vetted libraries. Avoid dynamic queries/commands built with user input concatenation.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
There was a problem hiding this comment.
The goal of that option is to used regexp. If we escape regexp, we cant use regexp. That alert is not very smart in our context i think.
Community contributors
Description
New plugin to Atlassian statuspage with json public files
CTOR-2244
Type of change
How this pull request can be tested ?
Checklist
Summary by Aikido
🚀 New Features
More info