Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
steam-appticket
Advanced tools
This module enables you to parse Steam encrypted app tickets provided you know the proper decryption key. This allows you to authenticate Steam users from your game backend without needing to verify with Steam that the ticket is valid.
ticket
- A Buffer
containing the encrypted app ticketencryptionKey
- A Buffer
or hex string containing the app's decryption keyconst AppTicket = require('steam-appticket');
// OR
import AppTicket from 'steam-appticket';
// OR
import {parseEncryptedAppTicket} from 'steam-appticket';
const ticket = Buffer.from('<ticket hex>', 'hex');
const decryptionKey = '6ef99262a7da9e9979737d0822d5d66d03eb0c580b305981a505648b3e21b12e';
console.log(AppTicket.parseEncryptedAppTicket(ticket, decryptionKey));
parseEncryptedAppTicket
returns an object containing these properties:
version
- The version of the app ownership ticketsteamID
- The ticket owner's SteamID, as a SteamID
objectappID
- The ID of the app this ticket authenticatesownershipTicketExternalIP
- A string containing the external IP address of the ticket owner as reported by Steam at the time when the ownership ticket was assignedownershipTicketInternalIP
- Same as above but for their internal IP. If the ticket was generated by steam-user then this may be randomownershipFlags
- A number containing some (probably uninteresting) flagsownershipTicketGenerated
- A Date
object containing the time when this ticket's ownership ticket was assignedlicenses
- An array of integers containing the package IDs for all the licenses the ticket owner owns which grant them this appdlc
- An array of objects, each of which contains:
appID
- The AppID of the piece of DLClicenses
- An array of integers containing the package IDs for all the licenses the ticket owner owns which grant them this DLC. Seems to not work right now.userData
- Whatever data was sent by the user to Steam when they requested the ticketReturns null
if the provided ticket could not be parsed or could not be verified for authenticity. If you get data
returned, it is guaranteed that it has not been tampered with, provided your encryption key has not been compromised.
To determine if a ticket is valid, you should do the following:
userData
matches what you expectIf you want to have a relatively long grace period in which an encrypted app ticket can be used, but you also want to
make sure that it wasn't reused, you can send a nonce to the client and have them build that into their encrypted app
ticket's userData
.
ticket
- A Buffer
containing the ticket you want to parseallowInvalidSignature
- Optional. Pass true
to get back data even if the ticket has no valid signature. Defaults to false
.const AppTicket = require('steam-appticket');
// OR
import AppTicket from 'steam-appticket';
// OR
import {parseAppTicket} from 'steam-appticket';
const ticket = Buffer.from('<ticket hex>', 'hex');
console.log(AppTicket.parseAppTicket(ticket));
You can also parse an app ticket that isn't encrypted. To do so, use AppTicket.parseAppTicket(ticket)
. It returns
an object with these properties:
authTicket
- A Buffer containing the part of the ticket that's sent to Steam for validationgcToken
- A string containing a 64-bit number which is the ticket's "GC token" (GC stands for "game connect")tokenGenerated
- A Date
object containing the time when this ticket's GC token was generatedsessionExternalIP
- A string containing the ticket owner's external IP address (as reported by Steam) at time of connection
clientConnectionTime
- Time in milliseconds the ticket owner was connected to Steam when they generated this ticket (?)clientConnectionCount
- Number of tickets generated by the ticket owner for this Steam connection (?)version
- The version of the app ownership ticketsteamID
- The ticket owner's SteamID, as a SteamID
objectappID
- The ID of the app this ticket authenticatesownershipTicketExternalIP
- A string containing the external IP address of the ticket owner as reported by Steam at the time when the ownership ticket was assigned
ownershipTicketInternalIP
- Same as above but for their internal IP. If the ticket was generated by steam-user then this may be random
ownershipFlags
- A number containing some (probably uninteresting) flagsownershipTicketGenerated
- A Date
object containing the time when this ticket's ownership ticket was assignedownershipTicketExpires
- Same as above but for when the ownership ticket expireslicenses
- An array of integers containing the package IDs for all the licenses the ticket owner owns which grant them this appdlc
- An array of objects, each of which contains:
appID
- The AppID of the piece of DLClicenses
- An array of integers containing the package IDs for all the licenses the ticket owner owns which grant them this DLC. Seems to not work right now.signature
- A Buffer
containing the signature for the app ownership ticket (uninteresting to you)isExpired
- A boolean indicating whether the app ownership ticket is expiredhasValidSignature
- A boolean indicating whether the app ownership ticket signature is validisValid
- A boolean indicating whether the app ownership ticket is valid
true
for allowInvalidSignature
and the signature is missing, this will be true if the ticket is not expired!Note that you shouldn't rely on an unencrypted app ticket without first verifying it with Steam.
FAQs
Decrypts and parses Steam app tickets
The npm package steam-appticket receives a total of 64,262 weekly downloads. As such, steam-appticket popularity was classified as popular.
We found that steam-appticket demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.