![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
server-side-app-integrity-check
Advanced tools
Server side library to generate nonces and check attestation tokens received from client apps within Android's Play Integrity API or Apple's App Attest API. It supports both classic and standard requests of Play Integrity API.
This is a Node.js module that is to be used in your app server to validate Android's app integrity tokens (or, attestation objects) sent by your clients. It can validate tokens of Android's Play Integrity API (either classic or standard requests). It does NOT support Android's deprecated SafetyNet API.
It is your responsibility to handle Google/Apple server outages (as those servers must inevitably be used in the attestation requests), to design your platform logic to conform to the API request rate limits such as onboarding users gradually (in iOS, attestation should be typically be performed once per user and device; Android's Play Integrity requests are throttled to 10,000 per app platform per day in the lowest tier among other limits), and to have a plan on how to handle clients that do not meet the maximum standards (for example, rooted devices or with Play Protect disabled), among other considerations.
If you need a library to generate attestation tokens on the client side (the app running on the users' devices), then check this out: Standard requests: https://github.com/sam-maverick/app-integrity-android-standard Classic requests: https://github.com/jeffDevelops/expo-app-integrity
If you need a library to check iOS attestations from the server side, then check this out: https://github.com/srinivas1729/appattest-checker-node
This work (code and documentation) is based on https://github.com/herzhenr/spic-server. See the attached license.
Define the necessary environment variables in a .env
file at the root of your project.
Use example.env
as a sample. Don't forget to rename it to .env
npm install server-side-app-integrity-check
If, for example, you have a CommonJS project, you can use the library in this way:
decryptPlayIntegrity()
Decrypt the token received from the client, to an object containing the raw attestation data.
let attestcheckerlibrary = await import('server-side-app-integrity-check');
decryptedToken = await attestcheckerlibrary.decryptPlayIntegrity(
token, // token the client received from the PlayIntegrity Server in the previous step
mode // Set to 'server' to check integrity locally. Set to 'google' to offload the check to Google servers
);
verifyPlayIntegrity()
Check the decrypted token validity. It checks that the nonce is correct, that the signatures are correct, and that all the fields indicate that the attestation is correct.
let attestcheckerlibrary = await import('server-side-app-integrity-check');
/** Check the token validity.
* It checks that the nonce is correct and that all the fields indicate that the attestation is correct.
* 'none_truth' is the ground truth of the nonce as stored by your app server
*/
attestationresult = attestcheckerlibrary.verifyPlayIntegrity(
decryptedToken, // as obtained from decryptPlayIntegrity()
nonce_truth // ground truth of the nonce as stored by your app server
);
Possible return values for attestationresult
:
{status: "fail", message: "Some explanatory message here", decryptedToken: "Here you will have the decrypted token"}
:=
Attestation was not successful. The app integrity is compromised or some other condition has occurred. Bear in mind that attestations will likely not succeed if an Android device has been rooted or if the device does not meet maximum standards.
{status: "error", message: "Some explanatory message here", decryptedToken: "Here you will have the decrypted token"}
:=
An unexpected error has occurred. Do not forget to also embrace the sample code above within a try-catch clause to capture any errors throwed by the module.
{status: "success", message: "Some explanatory message here", decryptedToken: "Here you will have the decrypted token"}
:=
Nice! The client passed the attestation. You will get a 'success' only if high security standards are met in the device environment. If you want to lower the standards, you will need to modify the code of this library yourself.
The project that gave rise to these results received the support of a fellowship from ”la Caixa” Foundation (ID 100010434). The fellowship code is LCF/BQ/DI22/11940036. This work was also supported by FCT through the LASIGE Research Unit (UIDB/00408/2020 and UIDP/00408/2020).
This work is licensed under the MIT license. See LICENSE for details.
FAQs
Server side library to generate nonces and check attestation tokens received from client apps within Android's Play Integrity API or Apple's App Attest API. It supports both classic and standard requests of Play Integrity API.
The npm package server-side-app-integrity-check receives a total of 22 weekly downloads. As such, server-side-app-integrity-check popularity was classified as not popular.
We found that server-side-app-integrity-check 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.