|
| 1 | +# Security Policy |
| 2 | + |
| 3 | +## Supported versions |
| 4 | + |
| 5 | +| Version | Supported | |
| 6 | +| ------- | --------- | |
| 7 | +| 2.x | Yes | |
| 8 | +| 1.x | No | |
| 9 | + |
| 10 | +1.x does not build on current Node.js and carries several memory-safety defects that |
| 11 | +2.0.0 fixed, including a fixed-size buffer that arbitrary-length Lua error messages |
| 12 | +were formatted into. Please upgrade rather than asking for a backport. |
| 13 | + |
| 14 | +## Reporting a vulnerability |
| 15 | + |
| 16 | +Please report privately through GitHub's |
| 17 | +[security advisory form](https://github.com/mschmicking/node-lua-runner/security/advisories/new) |
| 18 | +rather than opening a public issue. |
| 19 | + |
| 20 | +Include what you need to reproduce it: the Lua and JavaScript involved, your platform |
| 21 | +and Node.js version, and what you observed. |
| 22 | + |
| 23 | +If that form is not available to you, open an issue asking for a private channel — |
| 24 | +without the details — rather than posting them publicly. |
| 25 | + |
| 26 | +You should get an acknowledgement within a week or so. This is a spare-time project, |
| 27 | +so please treat that as a good-faith aim and not a guarantee. |
| 28 | + |
| 29 | +## Scope |
| 30 | + |
| 31 | +This package embeds a Lua interpreter in your Node.js process, which shapes what |
| 32 | +counts as a vulnerability here. |
| 33 | + |
| 34 | +**In scope** — anything in `src/` that lets *ordinary* use go wrong: memory |
| 35 | +corruption, use-after-free, or a process crash reachable from normal API calls or |
| 36 | +from Lua code with no unusual privileges. |
| 37 | + |
| 38 | +**Not in scope:** |
| 39 | + |
| 40 | +- **Running untrusted Lua.** This library gives Lua scripts the full standard |
| 41 | + library, including `os.execute`, `io.open` and `require`, plus LuaFileSystem. A Lua |
| 42 | + script can therefore run commands and read and write files with the privileges of |
| 43 | + your Node.js process. That is what embedding Lua means; it is not a defect in this |
| 44 | + package. Do not feed it code you would not run yourself. |
| 45 | +- **Misusing the low-level stack API.** This is a thin wrapper over the Lua C API and |
| 46 | + does not shield you from every misuse of it. Some operations on values of an |
| 47 | + unexpected type raise an *unprotected* Lua error, which aborts the process rather |
| 48 | + than throwing. `SetField` and `GetField` guard against this; other methods do not. |
| 49 | + A crash reached that way is documented behaviour, not a vulnerability. |
| 50 | +- **Findings in `vendor/`.** Lua 5.1.5 and LuaFileSystem are vendored verbatim and are |
| 51 | + not patched here. Report those upstream. If something in them is genuinely |
| 52 | + exploitable through this package's API, do report it here as well. |
0 commit comments