Sponsored Content
The Wayback Machine - https://web.archive.org/web/20210817024832/https://github.com/google/site-kit-wp/issues/756
Skip to content
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

Improve nonce generation for proxy #756

Closed
felixarntz opened this issue Oct 31, 2019 · 4 comments
Closed

Improve nonce generation for proxy #756

felixarntz opened this issue Oct 31, 2019 · 4 comments

Comments

@felixarntz
Copy link
Member

@felixarntz felixarntz commented Oct 31, 2019

Feature Description

The nonce generated for the proxy is intentionally not using WordPress nonces

  • because they're user-dependent
  • because they're not really nonces and valid multiple times

The current mechanism is a proper once-off nonce, however we still use wp_create_nonce() to generate that value, which, if used within multiple times within a short timeframe will still generate the same value. We should therefore replace it with a different generator mechanism, such as wp_generate_password().


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Use wp_generate_password() instead of wp_create_nonce() when generating the nonce for the proxy setup URL.

Implementation Brief

  • Use wp_generate_password() instead of wp_create_nonce() when generating the nonce for the proxy setup URL. :)

Changelog entry

  • Use more secure nonce generation mechanism for the authentication service.
@aaemnnosttv
Copy link
Collaborator

@aaemnnosttv aaemnnosttv commented Nov 1, 2019

IB ✅

@aaemnnosttv aaemnnosttv assigned felixarntz and unassigned aaemnnosttv Nov 1, 2019
@felixarntz felixarntz added this to the 1.1.0 milestone Nov 4, 2019
@felixarntz felixarntz removed their assignment Nov 4, 2019
@felixarntz felixarntz removed this from the 1.1.0 milestone Nov 7, 2019
@tofumatt tofumatt self-assigned this Nov 14, 2019
@tofumatt tofumatt assigned felixarntz and unassigned tofumatt Nov 14, 2019
@tofumatt tofumatt assigned aaemnnosttv and felixarntz and unassigned tofumatt Nov 15, 2019
@aaemnnosttv aaemnnosttv removed their assignment Nov 15, 2019
@felixarntz felixarntz removed their assignment Nov 16, 2019
@felixarntz felixarntz added this to the 1.0.5 milestone Nov 16, 2019
@cole10up cole10up assigned cole10up and unassigned cole10up Nov 19, 2019
@felixarntz felixarntz closed this Nov 20, 2019
@aaemnnosttv
Copy link
Collaborator

@aaemnnosttv aaemnnosttv commented Nov 20, 2019

This one is not ready to go yet and has introduced a bug since the nonce is not URL encoded; if the nonce contains an ampersand it breaks the value into separate parameters.

Raw proxy setup URL

image

Parsed Parameters

image

I will submit a PR for this shortly

@aaemnnosttv aaemnnosttv reopened this Nov 20, 2019
@aaemnnosttv aaemnnosttv self-assigned this Nov 20, 2019
@felixarntz felixarntz removed their assignment Nov 20, 2019
@tofumatt
Copy link
Collaborator

@tofumatt tofumatt commented Nov 20, 2019

Whoops, good catch, sorry 'bout that one 😓

@aaemnnosttv aaemnnosttv self-assigned this Nov 21, 2019
@aaemnnosttv
Copy link
Collaborator

@aaemnnosttv aaemnnosttv commented Nov 21, 2019

QA ✅

Confirmed that I was able to complete setup using a nonce that contained special characters (particularly an &).

image

Moving to Approval!

@aaemnnosttv aaemnnosttv removed their assignment Nov 21, 2019
@felixarntz felixarntz closed this Nov 21, 2019
@ThierryA ThierryA removed this from the 1.1.0 milestone Feb 3, 2020
@ThierryA ThierryA added this to the Sprint 11 milestone Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants