Skip to content

Commit a4e15b1

Browse files
mschmickingclaude
andcommitted
docs: add LICENSE and SECURITY.md
GitHub reported the licence as NOASSERTION/Other because its detector cannot parse LICENSE.md once the vendored Lua and LuaFileSystem notices are appended. Adding a plain LICENSE with only the canonical ISC text makes it detectable; LICENSE.md keeps the third-party notices and now points at it. package.json already declared ISC, so npm was never affected. SECURITY.md records what is and is not a vulnerability here, which matters more than usual for this package: embedding Lua hands scripts os.execute, io.open and LuaFileSystem, so running untrusted Lua is out of scope by construction rather than by oversight. Misuse of the low-level stack API is likewise documented rather than treated as a defect. Adds LICENSE to the files allowlist and to the release tarball guard. Verified the guard still passes: 67 files, SECURITY.md correctly not shipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 233a8bf commit a4e15b1

5 files changed

Lines changed: 73 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
}
8181
const files = entry.files.map(f => f.path);
8282
83-
const needed = ['index.js', 'binding.gyp', 'src/luastate.cc', 'src/nodelua.cc', 'src/utils.cc', 'vendor/lfs/lfs.c', 'README.md', 'LICENSE.md'];
83+
const needed = ['index.js', 'binding.gyp', 'src/luastate.cc', 'src/nodelua.cc', 'src/utils.cc', 'vendor/lfs/lfs.c', 'README.md', 'LICENSE', 'LICENSE.md'];
8484
const missing = needed.filter(n => !files.includes(n));
8585
if (missing.length) {
8686
console.error('missing from tarball:', missing.join(', '));

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2017, Medaeus245, 0x7878
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

LICENSE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
## License & Copyrights
33

4+
This project is ISC licensed. The canonical licence text lives in [LICENSE](LICENSE);
5+
this file repeats it and adds the notices for the third-party sources compiled into
6+
the addon.
7+
48
#### The ISC Licence (ISC) Copyright (c) 2017, Medaeus245, 0x7878
59

610
Permission to use, copy, modify, and/or distribute this software for any

SECURITY.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"src/",
2525
"vendor/",
2626
"README.md",
27+
"LICENSE",
2728
"LICENSE.md"
2829
],
2930
"scripts": {

0 commit comments

Comments
 (0)