-
Notifications
You must be signed in to change notification settings - Fork 17
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
Backport security fixes from Woo 3.5.4+ #214
Comments
This is well curated.
|
Obviously we need to work from oldest (3.5.5) to newest (3.8.0). |
Many of the commit IDs above are wrong (not part of the main WooCommerce history) so they can't be used as-is. As a starting point we need links to the PRs where these commits were introduced (if there are any?) Failing that, we need to use |
@timbocode I have run through most of the commit IDs and I am finding challenges as they are unknown commits with exception of f7a5449 |
Which commit IDs are wrong?? |
I guess I have some hiccups local. I tried to delete the local repo and git clone again but no change. I will try a different computer or directory |
@nylen has also said some commits are wrong so I don't think it's anything specific to your installation. But I'd just like to know which ones are wrong because I haven't got much to go on at the moment. |
Just had a minute to dig more deeply into this, there are two issues. When using the command line (GitHub Desktop may have equivalent operations but I'm not sure what they are) we set up a link to the WooCommerce repository and pull in a commit as follows:
First issue: There are two general ways to fix this:
Second issue: the ranges |
OK, I'm aware of To clone Woo locally, I used I then did a And I've also started from scratch using the above but again without success. 😞 |
This is the simplest way to fix this issue, no need to change the commit IDs:
|
The commit IDs are fine, the problem was that we weren't downloading all of the history from the WooCommerce repository. The steps I outlined above need to be run from within an existing Classic Commerce repository - this makes it possible to pull in the required commits using More generally, I have a question about how to handle these security fixes. Which of these approaches should we choose?
(1) is probably ideal, but (2) is what we do with ClassicPress core due to time and information limitations. |
Well first thing, I think we need to start with the earliest fix and work towards the latest. In other words, address issues in 3.5.5 first and then work towards 3.8.0. If that makes sense? As for how to handle these sort of issues, I do think we need to try and at least have some understanding of what each fix does but as for applying them, I'm inclined to go for option (2). The Woo team is much larger than ours, as is their user base, so effectively that means much real-world testing has already been done. I agree (1) would be the better option but we don't have time or resources. |
Yep, sounds good to me.
Makes sense to me also. |
We need to decide what level of review/testing is required for merging these. At a bare minimum I would propose the following:
Additionally, anything we can do to test these changes using basic flows like creating an order is also a good idea. #193 (end-to-end tests) would give a bit more confidence here, but those need more work to get them running again. |
I agree we need to give more thought to testing. I've given each of the PRs I've done so far the "once over" as far as looking at the diff is concerned but a second pair of eyes would be useful. Everything so far has passed the Travis tests which is good but not idiot-proof. 🙄 None of the PRs are ready to be merged. I'll need a bit of help if we're to update the automated tests. |
Just going back to the commit IDs above, if we take a look at "Ensure 404 pages with single product urls cannot be exploited using Open Redirect", this is found in 3.7.1 and 3.8.0. And in fact, if you search for "Add 404 check when creating add to cart url for single products.", three commits show up, all affecting file Using these commands:
returns these three commits:
two of which I have listed above (
So the question is, do we still need to do a commit for woocommerce/woocommerce@badb135 and woocommerce/woocommerce@f7a5449 or can we just do the one for woocommerce/woocommerce@dc1438d? |
The important thing is how the code ends up at the end. So I looked at all three of these commits, and they all result in that section of code being the same after the commit is applied (as one would hope). Given that, I don't see any need to apply all 3 commits, I would just pick the one that is easiest to apply (i.e. best matches the current CC code). It looks like that would be woocommerce/woocommerce@dc1438d as you said. Tracking which WooCommerce commits we've already applied to CC is another question. For that purpose it might make sense to mark all 3 of these commits as "applied" in CC since that will be effectively true. We're not really set up to do that yet though, so I suggest we not worry about it for beta1. I've opened #226 to discuss this as a separate topic. |
Thanks James. This is covered in PR #227. |
Copy/paste from #218 (review):
|
Backport for WC woocommerce/woocommerce@293d16f Also covers woocommerce/woocommerce@4d6ddf3 See also #214.
…products (#227) Backport from woocommerce/woocommerce@dc1438d See also #214
Backport from woocommerce/woocommerce@cabf9de See also #214
@timbocode Could you add the checkboxes (#214 (comment)) to the Merge order as well to consider progress of this issue? |
Backport for woocommerce/woocommerce@737f6af See also #214, #236 and #237
@bahiirwa yes, I'll take a look. A lot to catch up on. |
* Security fix: security check on email template preview page Backport from woocommerce/woocommerce@60148d7 See also #214 * Additional escaping in class-wc-admin.php Woo commit #14d9678 Co-authored-by: Paul Sealock <[email protected]>
As mentioned by @bahiirwa on Slack, we should consider backporting any significant security fixes from WC 3.5.4+ that are still applicable to CC.
I've pulled a list of security related fixes from all WC releases since 3.5.3 up to and including 3.9.1 (https://github.com/woocommerce/woocommerce/blob/master/CHANGELOG.txt).
Each will need to be looked into further and a PR created for each fix as required.
3.8.0 - 2019-11-05
3.7.1 - 2019-10-09
3.6.5 - 2019-07-02
3.6.2 - 2019-04-24
3.5.8 - 2019-04-16 woocommerce/woocommerce@3.5.7...3.5.8
Includes Woo commits:
woocommerce/woocommerce@1ef2739, woocommerce/woocommerce@2ecf61a, woocommerce/woocommerce@c39e0dc, woocommerce/woocommerce@e0382c5, woocommerce/woocommerce@211d9bf, woocommerce/woocommerce@70610f5, woocommerce/woocommerce@67fa997
3.5.7 - 2019-03-19 woocommerce/woocommerce@3.5.6...3.5.7
Includes Woo commits:
woocommerce/woocommerce@b626945, woocommerce/woocommerce@a2dee22, woocommerce/woocommerce@0a10883, woocommerce/woocommerce@039915f
3.5.5 - 2019-02-20
Merge Order
List of files updated
View files
3.5.5
PR #218
includes/class-wc-structured-data.php
includes/wc-formatting-functions.php
includes/admin/class-wc-admin-pointers.php
includes/admin/class-wc-admin-setup-wizard.php
includes/admin/class-wc-admin-assets.php
includes/admin/helper/class-wc-helper.php
includes/admin/meta-boxes/views/html-product-data-variations.php
includes/admin/reports/class-wc-admin-report.php
includes/admin/reports/class-wc-report-coupon-usage.php
includes/admin/reports/class-wc-report-customers.php
includes/admin/reports/class-wc-report-sales-by-category.php
includes/admin/reports/class-wc-report-sales-by-product.php
includes/admin/reports/class-wc-report-sales-by-date.php
includes/libraries/action-scheduler/classes/ActionScheduler_wpPostStore.php
includes/widgets/class-wc-widget-layered-nav.php
includes/api/legacy/v1/class-wc-api-json-handler.php
includes/api/legacy/v2/class-wc-api-json-handler.php
includes/api/legacy/v3/class-wc-api-json-handler.php
templates/single-product/add-to-cart/variable.php
tests/unit-tests/util/class-wc-tests-core-functions.php
PR #219
includes/wc-template-functions.php
3.5.7
PR #229
assets/js/admin/meta-boxes-order.js
assets/js/admin/meta-boxes-order.min.js
assets/js/frontend/country-select.js
assets/js/frontend/country-select.min.js
3.5.8
PR #230
assets/js/admin/users.js
assets/js/admin/users.min.js
assets/js/frontend/single-product.js
assets/js/frontend/single-product.min.js
assets/js/selectWoo/selectWoo.full.js
assets/js/selectWoo/selectWoo.full.min.js
assets/js/selectWoo/selectWoo.js
assets/js/selectWoo/selectWoo.min.js
includes/admin/class-wc-admin-assets.php
includes/admin/class-wc-admin-setup-wizard.php
includes/class-wc-frontend-scripts.php
3.6.2
PR #220
includes/admin/class-wc-admin.php
3.6.5
PR #221
includes/admin/class-wc-admin-importers.php
includes/admin/importers/class-wc-product-csv-importer-controller.php
PR #222
includes/admin/importers/class-wc-product-csv-importer-controller.php
includes/admin/importers/class-wc-tax-rate-importer.php
includes/wc-conditional-functions.php
3.7.1 & 3.8.0
PR #227
includes/class-wc-product-simple.php
PR #228
includes/wc-user-functions.php
The text was updated successfully, but these errors were encountered: