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

Search (both SearchDestinyPlayer and SearchByGlobalNamePrefix) throw errors when passed valid names that include : #1528

Closed
ChaseMalik opened this issue Sep 16, 2021 · 9 comments
Labels
bug filed A bug has been filed in BNet's internal bug tracking system for this request/report. bug

Comments

@ChaseMalik
Copy link

Player with membershipId 4611686018495392478 (membershipType 3) has a bungieGlobalDisplayName of Lu:na and bungieGlobalDisplayNameCode of 7531

Calling SearchDestinyPlayer for him:
https://www.bungie.net/d1/Platform/Destiny/SearchDestinyPlayer/-1/Lu%3Ana%237531/
Returns a 400 Bad Request (Actually the html for the bad request page, not a json response either)

Similarly calling SearchByGlobalNamePrefix:
https://www.bungie.net/Platform/User/Search/Prefix/Lu%3Ana%237531/0/
Returns the same 400 Bad Request

Note that the calls fail if the : is encoded or not.

@justrealmilk
Copy link

Apparently, this also includes names with ?

@mikechambers
Copy link

Also seems to include names with ">"

User name: HighImpactArea---->#9462

Memberid:4611686018485467244
platform: 3

with call:
https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/-1/HighImpactArea----%3E%239462/

returns a 400: Bad request. Note, when running this in postman, the 400 seems to come from cloudflare. When running in curl, the 400 seems to come from bungie.

@jshaffstall-bng jshaffstall-bng added bug bug filed A bug has been filed in BNet's internal bug tracking system for this request/report. labels Sep 28, 2021
@jshaffstall-bng
Copy link
Member

Good catches. These look like some broad anti-XSS and anti-SQL-injection counter-measures. Filed as TFS 1036093.

@Achronos-BNG
Copy link

Unfortunately, the only way to fix this is probably to alter the search functions so they are POST requests that take the input as post body data. The URL can't have those characters in it without triggering some very important anti-XSS and anti-injection checks. I'll have to consider the best way to go about such a transition.

@mikechambers
Copy link

@Achronos-BNG Thank you for the additional info on context. Sounds like this is not a quick / easy fix, and so we should work around it, rather than wait for a fix.

@floatingatoll
Copy link

Are the affected users still able to sign in with Bungie into the various third-party apps and view their own inventory and such, i.e. this only affects "search by name" and not "completely locked out of API"?

@mikechambers
Copy link

mikechambers commented Sep 29, 2021

@floatingatoll this impacts any apps that don't rely on oauth (i.e. lots of pvp stats) and use the api to access data (such as redrix). In the case of Redrix, it means some users won't be able to use the app, since we can't fall back to previous access (platform / name).

@rentalhost
Copy link

rentalhost commented Oct 13, 2021

A pretty similar case when use / (slash), but the error is 404. For me, the best solution for now is top using names in URL, but as querystring parameter.

Eg.

https://www.bungie.net/Platform/Destiny2/SearchDestinyPlayer/?bungieName={urlencode('X:Y/Z>W#1234')}

@jshaffstall-bng
Copy link
Member

There are new Bungie Name search APIs with POST requests to find names that include special characters.

https://bungie-net.github.io/multi/operation_post_User-SearchByGlobalNamePost.html#operation_post_User-SearchByGlobalNamePost

https://bungie-net.github.io/multi/operation_post_Destiny2-SearchDestinyPlayerByBungieName.html#operation_post_Destiny2-SearchDestinyPlayerByBungieName

Please migrate to these new APIs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug filed A bug has been filed in BNet's internal bug tracking system for this request/report. bug
Projects
None yet
Development

No branches or pull requests

7 participants