Skip to content

Temporarily block Cattiva dig sync to prevent build permission bypass#3282

Merged
QuiCM merged 1 commit intogeneral-develfrom
fix/cattiva-pick
Apr 3, 2026
Merged

Temporarily block Cattiva dig sync to prevent build permission bypass#3282
QuiCM merged 1 commit intogeneral-develfrom
fix/cattiva-pick

Conversation

@ACaiCat
Copy link
Copy Markdown
Member

@ACaiCat ACaiCat commented Apr 3, 2026

Temporarily block Cattiva dig sync to prevent build permission bypass

Vanilla Exploit

AI_067_FreakingPirates_HitIntention lacks an owner check. This causes the Server and all Clients to execute the PickTile logic.

  • Players can force the Server to internally execute PickTile, bypassing build permissions.
  • Other clients are also forced to execute the PickTile logic and send KillTile packets.

This exploit should be reported to Re-Logic.

@ACaiCat ACaiCat marked this pull request as ready for review April 3, 2026 09:28
@ACaiCat ACaiCat force-pushed the fix/cattiva-pick branch from 7c28bb6 to 6132ba0 Compare April 3, 2026 09:28
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 3, 2026

Greptile Summary

This PR adds a targeted server-side block for PalworldMinionCattiva (Cattiva) projectile sync packets when the projectile is in its dig state (ai[0] == 3f), preventing a vanilla Terraria exploit where the missing owner-check in AI_067_FreakingPirates_HitIntention lets any client force the server to execute PickTile logic and bypass build permissions.

Key points:

  • The fix is minimal and surgical: only the specific dig state (ai[0] == 3) of this one projectile type is blocked, other Cattiva states pass through normally.
  • The block is placed before the OnNewProjectile plugin hook, so plugins cannot accidentally re-enable the exploit path.
  • TShock.Log.ConsoleDebug is correctly used, consistent with every other packet-rejection log statement in the file (previously-raised concern was already resolved).
  • No kick or player notification is issued — the packet is silently dropped, which is a reasonable temporary mitigation posture.
  • The approach is explicitly labeled as temporary, pending an upstream fix from Re-Logic.

Confidence Score: 5/5

Safe to merge — the fix is a narrow, well-targeted one-state guard with no side-effects on other gameplay paths.

The change is minimal (8 lines), correctly uses ConsoleDebug (prior concern resolved), the floating-point comparison against 3f is exact-representable and safe for wire-read values, and the guard is placed before the plugin hook so no accidental bypass is possible. No P0/P1 issues found.

No files require special attention.

Important Files Changed

Filename Overview
TShockAPI/GetDataHandlers.cs Adds an early-return guard in HandleProjectileNew that drops PalworldMinionCattiva dig-state sync packets (ai[0] == 3) before they reach OnNewProjectile, neutralising the build-permission bypass exploit.

Sequence Diagram

sequenceDiagram
    participant C as Client (attacker)
    participant S as TShock Server
    participant T as Terraria World

    C->>S: ProjectileNew (PalworldMinionCattiva, ai[0]=3 dig state)
    Note over S: HandleProjectileNew<br/>type == PalworldMinionCattiva && ai[0] == 3f?
    alt Exploit blocked (this PR)
        S-->>S: ConsoleDebug log + return true (drop packet)
        Note over T: PickTile NOT executed<br/>Build permissions preserved
    else Before this PR
        S->>T: OnNewProjectile → PickTile executed
        Note over T: Tile destroyed, bypassing<br/>build permission checks
        T-->>C: KillTile broadcast to all clients
    end
Loading

Reviews (2): Last reviewed commit: "Block Cattiva dig sync to prevent build ..." | Re-trigger Greptile

Co-authored-by: RuyouSunshine <221790696+RuyouSunshine@users.noreply.github.com>
Co-authored-by: LaoSparrow <laosparrow@outlook.com>
@ACaiCat ACaiCat force-pushed the fix/cattiva-pick branch from 6132ba0 to 6f4441b Compare April 3, 2026 09:32
@ACaiCat
Copy link
Copy Markdown
Member Author

ACaiCat commented Apr 3, 2026

@greptile-apps review

Copy link
Copy Markdown
Contributor

@lost-werewolf lost-werewolf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and should function perfectly. Hopefully this is patched by ReLogic.

@QuiCM QuiCM merged commit d01bbb0 into general-devel Apr 3, 2026
17 checks passed
@QuiCM QuiCM deleted the fix/cattiva-pick branch April 3, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants