Skip to content

Crash on advert with short/truncated signature — unhandled Error from @noble/curves in isVerified() #8

@greentown0

Description

@greentown0

My instance is crashing relatively often (more than once a day) with the following error:

file:///app/node_modules/@noble/curves/esm/utils.js:93
throw new Error(title + ' of length ' + expectedLength + ' expected, got ' + len);
^
Error: signature of length 64 expected, got 18
at ensureBytes (file:///app/node_modules/@noble/curves/esm/utils.js:93:15)
at Object.verify (file:///app/node_modules/@noble/curves/esm/abstract/edwards.js:487:15)
at Advert.isVerified (file:///app/node_modules/@liamcottle/meshcore.js/src/advert.js:66:24)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Node.js v22.22.0

It seems like it receives a packet of type advert of the wrong length and this is unexpected and crashes. Luckily, due to this PR my container auto restarts and keeps on working, but without monitoring and autorestart, this would be a significant problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions