Skip to content

Script sanitisation and how to completely and near-pernamently detonate the compiler/VM... #51

@Vectrobe

Description

@Vectrobe

Issue type:

  • 🐛 Bug

Short description:

So in summary I was having a weird issue with a function either being "fun not defined", or a return type being "not a graal value when using [] or .at() on an array, or alternatively calling .get() would give "get not defined", so with all these I figured I might as well just check what happens when I put [] on the end of the input variable of the function.

but doing so resulted in... this...

Image

and much more seriously, this was pretty much pernament, while the game doesnt outright crash and you can still edit the script, any changes you made to the script, any variable cards wiped and re-created, outright removing the script disk and drive, wouldnt return the compiler, and seemingly the whole script system, into any form of functional state...

basically it seems like this mess of a compile error gets lodged into the compiler pernamently for any existing and new scripts fed into it, including blank ones

fortunately it doesnt seem to persist through server reboots, so to back out of the problem you of course must remove the initial problem of [] being in the function arguments, and then exit the world or reboot the server

although what might be a seperate additional problem I've noticed is that the ID network seems to report all script-linked variable cards as being "nonexistent" after re-entering the world, so you also must remove the script disk and all linked cards, re-add the disk and then re-add all the cards into the var store

Steps to reproduce the problem:

  1. define a function and put "[" into the input arguments?
  2. now the whole mod is broken? (at least until server/world shutdown)

Expected behaviour:

whats likely necessary is to add a sanitisation check for the function definition logic to make sure the string doesnt contain any []'s where it would cause things to break the compiler like this, and if possible some way to detect when a severe problem like this occurs and/or some way to flush/restart the compiler/VM


Versions:

  • This mod: 1.0.19
  • Minecraft: 1.21.1
  • Mod loader version: neo 214

Log file:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions