Installations
npm install steam-appticket
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=12.22.0
Node Version
12.22.12
NPM Version
6.14.16
Score
54.1
Supply Chain
99
Quality
77.1
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (53.7%)
JavaScript (46.3%)
Developer
Download Statistics
Total Downloads
4,374,872
Last Day
5,938
Last Week
58,458
Last Month
257,234
Last Year
1,499,038
GitHub Statistics
21 Stars
24 Commits
7 Forks
5 Watching
2 Branches
1 Contributors
Package Meta Information
Latest Version
2.0.1
Package Id
steam-appticket@2.0.1
Unpacked Size
45.00 kB
Size
12.25 kB
File Count
23
NPM Version
6.14.16
Node Version
12.22.12
Publised On
26 Aug 2024
Total Downloads
Cumulative downloads
Total Downloads
4,374,872
Last day
-25.1%
5,938
Compared to previous day
Last week
17.5%
58,458
Compared to previous week
Last month
14.5%
257,234
Compared to previous month
Last year
71%
1,499,038
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Steam App Ticket Parser
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.
Usage
parseEncryptedAppTicket(ticket, encryptionKey)
ticket
- ABuffer
containing the encrypted app ticketencryptionKey
- ABuffer
or hex string containing the app's decryption key
1const AppTicket = require('steam-appticket'); 2// OR 3import AppTicket from 'steam-appticket'; 4// OR 5import {parseEncryptedAppTicket} from 'steam-appticket'; 6 7const ticket = Buffer.from('<ticket hex>', 'hex'); 8const decryptionKey = '6ef99262a7da9e9979737d0822d5d66d03eb0c580b305981a505648b3e21b12e'; 9 10console.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 aSteamID
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
- ADate
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 ticket
Returns 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:
- Check that the AppID matches the AppID you expect
- If the user has already supplied their SteamID, make sure it matches the one in the ticket
- Make sure it hasn't been generated too far in the past for your liking
- If you built a nonce into the ticket, make sure the
userData
matches what you expect
If 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
.
Parsing Unencrypted App Tickets
parseAppTicket(ticket[, allowInvalidSignature])
ticket
- ABuffer
containing the ticket you want to parseallowInvalidSignature
- Optional. Passtrue
to get back data even if the ticket has no valid signature. Defaults tofalse
.
1const AppTicket = require('steam-appticket'); 2// OR 3import AppTicket from 'steam-appticket'; 4// OR 5import {parseAppTicket} from 'steam-appticket'; 6 7const ticket = Buffer.from('<ticket hex>', 'hex'); 8console.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
- ADate
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- Note that this is not authenticated and may be spoofed
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 aSteamID
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- This is authenticated and may not be spoofed, although it could be outdated since ownership tickets are cached for multiple days
ownershipTicketInternalIP
- Same as above but for their internal IP. If the ticket was generated by steam-user then this may be random- This is not authenticated and may be spoofed
ownershipFlags
- A number containing some (probably uninteresting) flagsownershipTicketGenerated
- ADate
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
- ABuffer
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- If you passed
true
forallowInvalidSignature
and the signature is missing, this will be true if the ticket is not expired!
- If you passed
Note that you shouldn't rely on an unencrypted app ticket without first verifying it with Steam.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/24 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/lint-and-build.yml:1
- Info: no jobLevel write permissions found
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3.7
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More