XASEMOTE - Security module to protect against RemoteSpy attacks

Greetings, Roblox game developers!

I’ve been working on a simplicity-first security module, named XASEMOTE. I’ve designed it to prevent RemoteSpy attacks and I thought sharing it with you all would be worth it.

This module provides cryptographic protection using algorithms, such as:

  • X25519
  • Ed25519
  • ChaCha20-Poly1305
  • BLAKE3

The API is supposed to be easy and simple to use, so you wouldn’t have to learn cryptography to use XASEMOTE.

Please note, that this module should be used synchronously, so please don’t spam the send function. And while XASEMOTE may secure the data, it is still very important to implement server-side validation.

You can see the documentation (with examples) and get XASEMOTE here:

It is open-source, so feel free to review and fork the branch! (My apology for not using GitHub properly.)

Feel free to try to break XASEMOTE and send feedback on it, I’d appreciate it! Thank you!

Credits to:

9 Likes

Overall pretty good, but you’re using the raw output from X25519.Exchange directly as the encryption key which is a no go. You should run it through a KDF like BLAKE3’s DeriveKey function. RFC 7748 section 6.1 explicitly says “Alice and Bob can then use a key-derivation function that includes K, K_A, and K_B to derive a symmetric key” basically you want to do something like KDF(shared_secret || your_public || their_public || "context") to get the actual key.

Nonce management is kinda sketchy. You’re doing nonce = BLAKE3(previous_nonce, 12) which creates this deterministic chain. Even though nonces don’t need to be secret, making them predictable goes against defense in depth, better designs use unpredictable nonces (random) or counters

And i’d also add a rate limit so someone can’t just spam and spike script usage and add proper replay protection where every message gets a sequence number that strictly increases rather than relying on tag_1 was computed for (ciphertext_1, nonce_1, key) but the server is trying to verify with (ciphertext_1, nonce_2, key)

4 Likes

Thank you very much for a detailed review, I’ll be looking forward into the issues you’ve noticed!

1 Like

Greetings, again!

I’ve worked on a new update and decided to roll it out to enhance the security of the module. In this update, I have:

  • Added key derivation.
  • Added counter-based nonce generation.
  • Added 25 request/second rate limiting.
  • Added 120-second timeout.
  • Removed LZ4, since Roblox already handles buffer compression via native ZSTD.

I strongly encourage to update if you have XASEMOTE installed in your game to get the latest security.

Feel free to search for the flaws and send feedback on them, I’d appreciate it! Thank you!

Thanks to @XoifaiI for proposing the changes!

1 Like

This is neat library, definitely using it.

1 Like

so, what is the point of using setfenv here, also me when i hook the send function

setfenv is used to protect the raw RemoteFunction.InvokeServer calls. This can stop simple getfenv attacks.

Though, while the exploiters can use advanced techniques with getgc (that’s why i used newproxy(true)) and other functions, it’s futile to wrap xsm.send in setfenv, since that’ll break the function and they’ll rather just hook the CC20.Encrypt/CC20.Decrypt or ser.serialize/ser.deserialize anyway.

It’s not that easy to defend against memory attacks, where people would likely resolve into security-through-obscurity. Even TLS 1.3 is vulnerable to such attacks.

Your way of using GitHub kind of looks like this: Instead of putting the source code to your app, you push the binary instead, and pull requests just change the contents of the binary. No one will contribute to your library if you don’t follow simple concepts.

1 Like

Sorry for my idiocy, but thanks for the reminder. I’ll look into it.

1 Like

Not idiocy at all, in fact I actually did that with one of my old projects as I couldn’t figure out how to set up Rojo.

1 Like

All this just to get the key through filtergc

3 Likes

Clientside isn’t so easy to defend against… Still, serverside validation is still worth implementing and it already deters most exploiters away.

I’ve abandoned XASEMOTE, since I’ve lost access to Roblox Studio due to geopolitical blocks (so I’m using a VPN to send this message) and I don’t want to support Roblox anymore due to the horrible decisions Roblox have done…

2 Likes