It's possible to put whitespace into the Stripe keys, and then the only thing that happens is you get a JS console error and lots of misbehavior. Trim whitespace from the keys before saving.
Edit: Also validate the key format to be exactly what it should be.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | uc_stripe.validate_keys_2605838_04.patch | 7.59 KB | rfay |
Comments
Comment #2
ayesh commentedCould you look into https://security.drupal.org/node/156634 please?
I think that issue and this one can be done in a single shot.
Comment #3
rfayComment #4
rfayThis patch does 4 things that were recently discovered as necessary:
1. Catches exception thrown by Stripe.js if a key is invalid (or perhaps as-yet undiscovered exceptions)
2. Trims whitespace of entered keys in the Stripe settings form and applies check_plain()
3. Validates keys against a regex that excludes all but alphanumeric and underscore
4. Runs check_plain against any key retrieved from variable_get().
Comment #6
rfayFixed in ba81f78 for 7.x-2.x, now reworking for 6.x-2.x
Comment #8
rfayFixed in b73b342 for 6.x-2.x-dev
Although there were no reviews of these patches, reviews are still welcome if you see any issues.