-
Notifications
You must be signed in to change notification settings - Fork 1
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
PO-242 : added esc_url for security fix #22
Conversation
</div> | ||
<div class="row"> | ||
<div class="col-sm-4 panel-label">Created on</div> | ||
<div class="col-sm-8 panel-value">'.$button_detail['created_at'].'</div> | ||
<div class="col-sm-8 panel-value">' . esc_html($button_detail['created_at']) . '</div> | ||
</div> | ||
</div> | ||
<div class="col-md-7">'.$button_detail['html_content_item'].'</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Echo
ing user input risks cross-site scripting vulnerability. You should use htmlentities()
when showing data to users.
View Dataflow Graph
flowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>templates/razorpay-button-view-templates.php</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0["<a href=https://github.com/razorpay/payment-button-elementor-plugin/blob/d53d01809c8fef793483f449b55ea821b34613a5/templates/razorpay-button-view-templates.php#L28 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 28] $_REQUEST</a>"]
end
%% Intermediate
subgraph Traces0[Traces]
direction TB
v2["<a href=https://github.com/razorpay/payment-button-elementor-plugin/blob/d53d01809c8fef793483f449b55ea821b34613a5/templates/razorpay-button-view-templates.php#L28 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 28] $pagenum</a>"]
v3["<a href=https://github.com/razorpay/payment-button-elementor-plugin/blob/d53d01809c8fef793483f449b55ea821b34613a5/templates/razorpay-button-view-templates.php#L29 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 29] $previous_page_url</a>"]
end
v2 --> v3
%% Sink
subgraph Sink
direction LR
v1["<a href=https://github.com/razorpay/payment-button-elementor-plugin/blob/d53d01809c8fef793483f449b55ea821b34613a5/templates/razorpay-button-view-templates.php#L34 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 34] echo '<div class="wrap"><br> <div class="content-header"><br> <a href="'.$previous_page_url.'"><br> <span class="dashicons rzp-dashicons dashicons-arrow-left-alt"></span> Button List<br> </a><br> <span class="dashicons rzp-dashicons dashicons-arrow-right-alt2"></span>'. esc_html($button_detail['title']) . '<br> </div><br> <div class="container rzp-container"><br> <div class="row panel-heading"><br> <div class="text">' . esc_html($button_detail['title']) . '</div><br> </div><br> <div class="row panel-body"><br> <div class="col-md-5 panel-body-left"><br> <div class="row"><br> <div class="col-sm-4 panel-label">Button ID</div><br> <div class="col-sm-8 panel-value">' . esc_html($button_detail["id"]) . '</div><br> </div><br> <div class="row"><br> <div class="col-sm-4 panel-label">Button Status</div><br> <div class="col-sm-8 panel-value"><br> <span class="status-label">' . esc_html$button_detail['status']) . '</span><br> <button onclick="'.$show.'" class="status-button">' . esc_html($button_detail['btn_pointer_status']) . '</button><br> </div><br> </div><br> <div class="row"><br> <div class="col-sm-4 panel-label">Total Quantity Sold</div><br> <div class="col-sm-8 panel-value">' . htmlentities($button_detail['total_item_sold']) . '</div><br> </div><br> <div class="row"><br> <div class="col-sm-4 panel-label">Total revenue</div><br> <div class="col-sm-8 panel-value"><span class="rzp-currency">₹ </span>' . esc_html($button_detail['total_revenue']) . '</div><br> </div><br> <div class="row"><br> <div class="col-sm-4 panel-label">Created on</div><br> <div class="col-sm-8 panel-value">' . esc_html($button_detail['created_at']) . '</div><br> </div><br> </div><br> <div class="col-md-7">'.$button_detail['html_content_item'].'</div><br> </div> <br> </div><br> <br> </div>';</a>"]
end
end
%% Class Assignment
Source:::invis
Sink:::invis
Traces0:::invis
File0:::invis
%% Connections
Source --> Traces0
Traces0 --> Sink
</div>');
<sub>⚪️ This finding does not block your pull request.
</sub><br/><sub>
<a href="https://semgrep.dev/docs/ignoring-files-folders-code">Ignore this finding</a> from <a href="https://semgrep.dev/playground/r/RGTKGXN/php.lang.security.injection.echoed-request.echoed-request?utm_campaign=finding_notification&utm_medium=review_comment&utm_source=github&utm_content=rule">echoed-request</a>.
</sub>
<!--
🤫 WELCOME TO SECRET SEMGREP! 🤫
This information is for debugging purposes and does not appear in rendered PR comments.
Finding id: 105423697
Syntactic id: 830568d0e859b0a7a0e329f71809bbfc
Start line: 34,9
End line: 75,17
Index: 0
-->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep Assistant thinks this might be safe to ignore. The user input from $_request['paged'] is sanitized using sanitize_text_field before being used, which mitigates the risk of cross-site scripting. the finding is not exploitable in this context.
AI-generated comment; review carefully.
Leave a 👍 reaction to ignore the finding. Reacting with 👍 or 👎 also provides feedback to improve Assistant's future comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.