‹ARES offensive division vulnerability research

Pesquisa de VulnerabilidadeVulnerability Research

Três vulnerabilidades na Microsoft StoreThree Microsoft Store vulnerabilities

Depois de furar os métodos de pagamento da Microsoft Store, achei mais três falhas de lógica: gerar nota fiscal de jogos do Xbox sem pagar nada, encher a carteira da loja com os “presentes” de reembolso, e curtir a edição Ultimate pagando só o preço da Standard.After bypassing the Microsoft Store payment methods, I found three more logic flaws: generating tax invoices for Xbox games without paying, refilling the store wallet with refund “gifts”, and enjoying the Ultimate edition while paying only the Standard price.


CVE ID
Severity
High
Affected
Microsoft Store · Xbox payment flow
Vendor
Microsoft
Disclosure
Reportado à MicrosoftReported to Microsoft
Researcher
Marlon Fabiano

Descrição das três vulnerabilidades: “gerar nota fiscal na Microsoft Store sem fazer compras”, “adicionar dinheiro na carteira da Microsoft Store” e “comprar jogos Definitive / Deluxe / Ultimate pelo preço de um jogo standard”.Description of the three vulnerabilities: “generating invoices in the Microsoft Store without making purchases”, “adding money to the Microsoft Store Wallet”, and “buying Definitive / Deluxe / Ultimate games for the price of a standard game”.

O resumo dos passos dos dois bypass (compras de jogos e assinaturas infinitas dentro da sandbox da Microsoft) está no link: https://github.com/smarlonfabiano/xbox_xplA summary of the steps for the two bypasses (infinite game and subscription purchases inside Microsoft’s sandbox) can be found at the link: https://github.com/smarlonfabiano/xbox_xpl

Depois de furar os métodos de pagamento pela primeira vez e assinar os serviços do Game Pass através da sandbox de desenvolvedores da Microsoft, encontrei outras três falhas de lógica nos processos de pagamento da Microsoft.After bypassing the payment methods the first time and subscribing to the Game Pass subscription services through Microsoft’s developer sandbox, I found three other logic flaws in Microsoft’s payment processes.

ConteúdoContents

Vulnerabilidade 1Vulnerability 1

Entendendo a vulnerabilidade que permite gerar nota fiscal de jogos do Xbox sem comprá-los, e a possibilidade de lucrar através da Nota Fiscal Paulista.Understanding the vulnerability that lets you generate invoices for Xbox games without buying them, and the possibility of profiting through the Nota Fiscal Paulista program.

Um dos bugs permite que um agente malicioso gere notas fiscais de jogos do Xbox mesmo sem a compra ter sido feita. Essa vulnerabilidade poderia ser usada por um golpista para ganhar dinheiro às custas do prejuízo financeiro da Microsoft. Isso porque existe a possibilidade, através do programa “Nota Fiscal Paulista”, de o consumidor resgatar parte do valor pago em imposto.One of the bugs lets a malicious agent generate invoices for Xbox games even when no purchase is made. This vulnerability could be used by a scammer to make money off Microsoft’s financial losses, because the “Nota Fiscal Paulista” program lets the consumer redeem part of the tax amount paid.

Como a Microsoft Store gera as NFs sem nenhum tipo de controle, dá pra tentar comprar jogos em pré-venda sem pagar por eles. E mesmo quando as licenças dos jogos são revogadas por falta de pagamento, o golpista ainda recebe a nota fiscal do jogo como se a compra tivesse sido feita. Com isso, o Xbox paga o imposto do jogo vendido e o golpista pode lucrar até 30% do valor do ICMS.Because the Microsoft Store generates invoices (NFs) without any kind of control, you can try to buy pre-sale games without paying for them. And even when the game licenses are revoked for non-payment, the scammer still receives the game invoice as if the purchase had been made. With that, Xbox pays the tax on the sold game and the scammer can profit up to 30% of the ICMS value.

Reproduzindo a vulnerabilidadeReproducing the vulnerability

Primeiro, precisamos relembrar uma das primeiras vulnerabilidades que reportei à Microsoft, onde era possível comprar jogos da Microsoft Store sem pagar por eles.First, we need to recall one of the first vulnerabilities I reported to Microsoft, where it was possible to buy games from the Microsoft Store without paying for them.

Reproduzindo a primeira vulnerabilidade:Reproducing the first vulnerability:

  1. Cadastramos um cartão válido na nossa conta do Xbox Live ou MSA.We register a valid card on our Xbox Live or MSA account.
  2. Cancelamos e bloqueamos o cartão de crédito no banco emissor. Também dá pra usar uma conta PayPal sem cartão de crédito cadastrado ou um cartão de crédito pré-pago.We cancel and block the credit card at the issuing bank. We can also use a PayPal account with no credit card registered, or a prepaid credit card.
  3. Agora, com um cartão inválido, conta PayPal ou cartão pré-pago, podemos comprar os jogos em pré-venda. Como a cobrança também pode ser feita 10 dias antes do lançamento, conseguimos baixar os jogos sem que a taxa do jogo seja cobrada.Now, with an invalid card, PayPal account or prepaid card, we can buy the games on pre-order. Since the charge can also happen 10 days before launch, we’re able to download the games without having the game fee charged.
  4. A tentativa de débito do cartão cadastrado é feita 10 dias antes do lançamento do jogo, e você pode receber várias notificações informando sobre a falha no pagamento.The attempted debit of the registered card happens 10 days before the game’s launch, and you may receive several notifications about the payment failure.
  5. Nesse momento, a primeira falha foi encontrada, já que a licença do produto não era revogada. Agora, com a vulnerabilidade corrigida e a licença revogada, não teremos acesso ao produto, mas o resto dos processos financeiros continua independentemente do pagamento ter sido feito ou não.At this point, the first flaw was found, since the product license wasn’t revoked. Now, with the vulnerability fixed and the license revoked, we won’t have access to the product — but the rest of the financial processes keep going regardless of whether payment was made or not.

Então, quando a Microsoft revoga a licença do jogo, podemos ir na nossa conta MSA e reparar que vamos receber a nota fiscal do produto sem ter pago por ele.So when Microsoft revokes the game license, we can go to our MSA account and notice that we’ll receive the product invoice without having paid for it.

Agora entendendo como ganhar dinheiro com a falhaNow understanding how to make money from the flaw

  1. O agente malicioso usa o bug para obter várias notas fiscais sem pagar pelos jogos.
    Exemplo: o atacante compra R$ 10.000 em jogos usando várias contas MSA.
    The malicious agent uses the bug to obtain multiple invoices without paying for the games.
    Example: the attacker buys R$ 10,000 worth of games using multiple MSA accounts.
  2. A Microsoft gera a nota fiscal e paga R$ 1.700 para o estado de São Paulo (a alíquota fica em torno de 17%).Microsoft generates the invoice and pays R$ 1,700 to the state of São Paulo (the rate is around 17%).
  3. Mesmo sem o pagamento dos jogos ser feito, o agente malicioso recebe as notas fiscais depois de ter as licenças dos jogos revogadas pela Microsoft.Even though payment for the games is never made, the malicious agent receives the invoices after having the game licenses revoked by Microsoft.
  4. O golpista entra no site https://www.nfp.fazenda.sp.gov.br/login.aspx e resgata R$ 510 no CPF dele ou no CPF de uma vítima.The scammer logs into https://www.nfp.fazenda.sp.gov.br/login.aspx and redeems R$ 510 on his own CPF or on a victim’s CPF.

Com isso em mente, dá pra criar várias contas e assim comprar o mesmo jogo várias vezes:With that in mind, we can create multiple accounts and buy the same game multiple times:

NotaNote

O salário mínimo no Brasil é R$ 1.100. O golpista consegue chegar a quase 5 vezes esse valor aplicando golpes na Microsoft.The minimum wage in Brazil is R$ 1,100. The scammer can reach almost 5 times that amount by running scams on Microsoft.

PoCPoC

Microsoft Store invoice generated without payment
Nota fiscal gerada pela Microsoft Store mesmo sem o pagamento do jogo.Invoice generated by the Microsoft Store even without payment for the game.
Order details for the unpaid Xbox game
Detalhes do pedido do jogo, com a licença revogada mas a NF emitida.Order details for the game, with the license revoked but the invoice issued.
Tax invoice document for the game
Documento fiscal do jogo elegível para resgate na Nota Fiscal Paulista.Tax invoice for the game, eligible for redemption through the Nota Fiscal Paulista.

Materiais de apoio / referênciasSupporting materials / references

  1. Portal da Fazenda — Nota Fiscal Paulista.Fazenda Portal — Nota Fiscal Paulista. https://portal.fazenda.sp.gov.br/servicos/nfp
  2. Como é feito o cálculo do crédito.How the credit is calculated. https://portal.fazenda.sp.gov.br/servicos/nfp/Paginas/Como-%C3%A9-feito-o-c%C3%A1lculo-do-cr%C3%A9dito.aspx
  3. Época Negócios — Como ganhar dinheiro com a Nota Fiscal Paulista.Época Negócios — How to make money with the Nota Fiscal Paulista. https://epocanegocios.globo.com/colunas/Financas-de-Bolso/noticia/2017/01/como-ganhar-dinheiro-com-nota-fiscal-paulista.html

Vulnerabilidade 2Vulnerability 2

Entendendo a vulnerabilidade que permite adicionar dinheiro infinito na carteira da Microsoft Store:Understanding the vulnerability that lets you add infinite money to the Microsoft Store wallet:

Continuando a mesma reprodução do bug anterior: quando recebemos as notas fiscais dos jogos comprados, mas não recebemos o jogo em si. Existe um período em que dá pra jogar os jogos comprados com o bug, que é de 1 a 3 dias depois do lançamento. Depois disso, a licença do jogo é revogada e você não consegue mais jogar. Com isso, existe um processo que valida se o usuário que recebeu a nota fiscal também recebeu o jogo. Se o usuário, mesmo depois de receber a nota fiscal, ainda não recebeu o jogo, o valor da compra é reembolsado para o cartão de crédito cadastrado. Mas, como a gente não tem um cartão válido para o reembolso, não recebemos o reembolso.Continuing the same reproduction as the previous bug: when we receive the invoices for the purchased games, but we don’t receive the game itself. There’s a window in which you can play the games bought with the bug — from 1 to 3 days after release. After that, the game license is revoked and you can’t play it anymore. So there’s a process that validates whether the user who received the invoice also received the game. If the user, even after receiving the invoice, still hasn’t received the game, the purchase amount is refunded to the registered credit card. However, since we don’t have a valid card for the refund, we don’t actually get refunded.

Para amenizar toda essa confusão com a compra e agradar o cliente, a Microsoft manda um “presente” de R$ 27,00. Mas o que acontece se a gente reproduzir esse mesmo bug várias vezes seguidas? Pois é, a resposta está aqui:To ease all this confusion with the purchase and to please the customer, Microsoft sends a “gift” of R$ 27.00. But what happens if we reproduce this same bug several times in a row? Well, here’s the answer:

PoCPoC

Microsoft store credit gift after a failed purchase
A Microsoft envia um “presente” de crédito depois da compra falhar.Microsoft sends a credit “gift” after the purchase fails.
Store wallet balance increasing from repeated refund gifts
O saldo da carteira sobe com os “presentes” de reembolso repetidos.The wallet balance grows from the repeated refund “gifts”.
Another refund gift credited to the account
Mais um crédito de reembolso entrando na conta.Another refund credit landing in the account.
Accumulated balance in the Microsoft Store wallet
Saldo acumulado na carteira da Microsoft Store.Accumulated balance in the Microsoft Store wallet.
Wallet funds usable across Microsoft and Xbox stores
Os fundos da carteira podem ser usados em toda a loja.The wallet funds can be spent across the whole store.
Final wallet balance built up from refund gifts
Saldo final construdo a partir dos “presentes” de reembolso.Final balance built up from the refund “gifts”.

Então, dá pra repetir esse processo com paciência várias vezes para receber dinheiro de reembolso.So it’s possible to patiently repeat this process several times to receive refund money.

Um agente malicioso poderia criar várias contas, adicionar dinheiro na carteira dessas contas e revender os jogos da loja. Como existe a opção de comprar o jogo como presente, os jogos poderiam ser enviados ou vendidos para qualquer usuário do Xbox Live.A malicious agent could create multiple accounts, add money to those accounts’ wallets, and resell the store’s games. Because there’s an option to buy a game as a gift, the games could be sent or sold to any Xbox Live user.

Outro ponto importante é que não existe segregação entre a Microsoft Store e a loja do Xbox. Por isso, se um bom valor for adicionado à conta do usuário, além de jogos, esse usuário vai conseguir comprar licenças de Windows, Office 365, teclado, mouse, notebooks etc.Another important point is that there’s no segregation between the Microsoft Store and the Xbox store. So if a decent amount is added to the user’s account, beyond games, that user will be able to buy licenses for Windows, Office 365, a keyboard, a mouse, laptops, etc.

Vulnerabilidade 3Vulnerability 3

Entendendo a vulnerabilidade que permite comprar jogos Ultimate/Deluxe/Definitive pagando só o preço de um jogo Standard:Understanding the vulnerability that lets you buy Ultimate/Deluxe/Definitive games while paying only the price of a Standard game:

Ainda seguindo a mesma lógica do bug. Além das duas vulnerabilidades acima, reportei a vulnerabilidade que me permite comprar jogos na edição Standard e curtir a edição Ultimate. Como assim?Still following the same logic as the bug. On top of the two vulnerabilities above, I reported the vulnerability that lets me buy a Standard Edition game and enjoy the Ultimate Edition. How does that work?

Reproduzindo a falhaReproducing the flaw

  1. Siga os mesmos passos que usamos para gerar notas fiscais sem pagar pelo jogo. A diferença é que, neste caso, devemos escolher a versão mais cara do jogo (lembrando que esse bug funciona para jogos em pré-venda).Follow the same steps we used to generate invoices without paying for the game. The difference is that, in this case, we must choose the most expensive version of the game (remembering that this bug works for pre-order games).
  2. Fazendo o teste no jogo Watch Dogs Legion, em que a edição Standard custa R$ 279,95 e a edição Ultimate custa R$ 459,95.Running the test on Watch Dogs Legion, where the Standard edition costs R$ 279.95 and the Ultimate edition costs R$ 459.95.
Watch Dogs Legion Ultimate edition store page
Página da edição Ultimate de Watch Dogs Legion (R$ 459,95).Watch Dogs Legion Ultimate edition store page (R$ 459.95).
Watch Dogs Legion Standard edition store page
Página da edição Standard de Watch Dogs Legion (R$ 279,95).Watch Dogs Legion Standard edition store page (R$ 279.95).

3 - Compramos o jogo na edição Ultimate com um cartão inválido e, quando o jogo é lançado, temos a licença revogada. E se a gente tentar jogar depois do lançamento, recebemos a mensagem de que o jogo precisa ser comprado de novo.3 - We buy the game in the Ultimate edition with an invalid card and, when the game launches, we get the license revoked. And if we try to play it after release, we get the message that the game must be purchased again.

O problema é que o Xbox revoga só a licença do jogo, e não a licença do conteúdo premium, Season Pass, DLCs etc. Então, nesse caso, mesmo não tendo mais a licença do jogo base, a gente ainda tem a licença de todo o resto do conteúdo premium.The problem is that Xbox revokes only the game license, not the license for premium content, Season Pass, DLCs, etc. So in this case, even though we no longer have the base game license, we still hold the license for all of the rest of the premium content.

Agora, para curtir o jogo na edição Ultimate (valor de R$ 459,95), só precisamos comprar a versão standard do jogo pagando R$ 279,95. Isso nos dá uma economia — e um prejuízo para a Microsoft/Ubisoft — de R$ 180,00.Now, to enjoy the game in the Ultimate edition (a R$ 459.95 value), we only need to buy the standard version of the game, paying R$ 279.95. This gives us savings — and a loss for Microsoft/Ubisoft — of R$ 180.00.