Repository navigation
fix(security): escape the raw Blade outputs, and justify the ones that must stay raw - #20
Merged
Merged
Conversation
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.
The harness (SEC-04) reported 114
{!! !!}outputs in 64 views. Each one is now one of:wp_kses_post()for prices, messages, titles and sentences built withsprintf();esc_html()for labels, dates and the billing email;esc_attr()around the$_POST/$_REQUESTvalues of the login and tracking forms (same result as before, the call moved to the outside). The store notice (get_option('woocommerce_demo_store_notice')), which printed an admin-typed field as it was, goes throughwp_kses_post()like WooCommerce does.aria-currentandreadonlyuse@ifinstead of printing a string; thecalculated_shippingclass and the comment id use{{ }}.nosemgrepthat says why (49): the theme's own SVG icons, and the markup WooCommerce builds and escapes itself (product images, buttons, remove links, tab callbacks,the_content), wherewp_kses_post()would strip attributes.observed: securityis dropped from the harness workflow: the gate blocks again. The views still compile and parse as PHP (checked against the previous version of each file); the Semgrep rule of harness v0.1.13 reports nothing.