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

Wrong grant type in the response to Grants::FetchGrants is resolved as Ads grant and presented on UI so. #6711

Closed
gdregalo opened this issue Nov 1, 2019 · 1 comment · Fixed by brave/brave-core#3918

Comments

@gdregalo
Copy link

gdregalo commented Nov 1, 2019

Description

If server by mistake sends unexpected value in grant.type in response to FetchGrants, then it will be resolved as ads grant and presented to a user so.
https://github.com/brave/brave-core/blob/master/components/brave_rewards/browser/rewards_notification_service_impl.cc#L337.
It would be good if we have a check for acceptable grants types when parsing json.

Steps to Reproduce

  1. Modify grant type when parsing json response to FetchGrants.

Actual result:

The Ads grants is presented on UI.
Observable on Android.

Expected result:

Check for acceptable grants types when parsing json response. Ignore corrupted response or log it and add to statistics sent back to Brave.

Reproduces how often:

Brave version (brave://version info)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the dev channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

@gdregalo gdregalo added the bug label Nov 1, 2019
@NejcZdovc
Copy link
Contributor

this one should be addressed with brave/brave-core#3918

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants