-
Notifications
You must be signed in to change notification settings - Fork 69
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
Ensure URLs in dispute order note are urlencoded before passed to add_query_arg() to follow best practice #7399
Comments
Is this an issue? As I understand it this string should be escaped correctly. The chance of it being exploited is probably low, so this might be a linter / best practice issue. |
Thanks @haszari, I am incorrect in that statement so I've removed it. I had in my mind that all reserved characters need to be percent-encoded when being used in a query string. But From https://www.rfc-editor.org/rfc/rfc3986#section-3.4:
|
@Jinksi can you test or investigate to confirm if there's impact/risk here? Not clear from the description, I figure someone needs to explore.
|
IMO there is no real impact or risk here. @shendy-a8c can I get your opinion on this? Uou noticed this as a problem in code review #7087 (comment) and may have a better idea of the impact this could have. |
I can't see any risk or impact. It's just that it's not a best practice. |
Thanks @shendy-a8c – based on that this is a mini tech debt issue and we should fix it when we get a chance. Setting as low priority 👍🏻 |
@shendy-a8c can you update the description and title so it's super clear what the problem is, and what the outcome/goal is? So it's easy for anyone to pick up and action 🚀 |
Upgrading to medium priority as this is a code best practice that we should do. If this is impractical or not needed we can close. |
URLs query string parameters used for links to the transaction details screen from disputed order notes are not URL-encoded.
add_query_arg() does not encode the parameter value. It expects the parameter value already encoded which currently, it is not url-encoded.
Note
Nothing breaks due to this issue. It's just that it's not a best practice that was picked up from #7087 (comment).
When @Jinksi tried to url-encode it, a new problem arose #7087 (comment). Hence, it needs further investigation as to why that is.
WC_Payments_Order_Service::compose_dispute_url
WC_Payments_Webhook_Processing_Service::process_webhook_dispute_updated
The text was updated successfully, but these errors were encountered: