onyx-scan 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- onyx_scan-0.2.2/LICENSE +105 -0
- onyx_scan-0.2.2/PKG-INFO +187 -0
- onyx_scan-0.2.2/README-PYPI.md +170 -0
- onyx_scan-0.2.2/README.md +170 -0
- onyx_scan-0.2.2/onyx/__init__.py +0 -0
- onyx_scan-0.2.2/onyx/baseline.py +96 -0
- onyx_scan-0.2.2/onyx/cli.py +229 -0
- onyx_scan-0.2.2/onyx/finding_help.py +217 -0
- onyx_scan-0.2.2/onyx/lexer.py +200 -0
- onyx_scan-0.2.2/onyx/luau/__init__.py +0 -0
- onyx_scan-0.2.2/onyx/luau/harness.luau +138 -0
- onyx_scan-0.2.2/onyx/luau/mock.luau +906 -0
- onyx_scan-0.2.2/onyx/place.py +303 -0
- onyx_scan-0.2.2/onyx/policy.py +213 -0
- onyx_scan-0.2.2/onyx/rules.py +2961 -0
- onyx_scan-0.2.2/onyx/sandbox.py +254 -0
- onyx_scan-0.2.2/onyx/scan.py +179 -0
- onyx_scan-0.2.2/onyx/verify.py +955 -0
- onyx_scan-0.2.2/onyx_scan.egg-info/PKG-INFO +187 -0
- onyx_scan-0.2.2/onyx_scan.egg-info/SOURCES.txt +23 -0
- onyx_scan-0.2.2/onyx_scan.egg-info/dependency_links.txt +1 -0
- onyx_scan-0.2.2/onyx_scan.egg-info/entry_points.txt +2 -0
- onyx_scan-0.2.2/onyx_scan.egg-info/top_level.txt +1 -0
- onyx_scan-0.2.2/pyproject.toml +33 -0
- onyx_scan-0.2.2/setup.cfg +4 -0
onyx_scan-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Onyx Static (onyxstaticrbx)
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
onyx_scan-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: onyx-scan
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Static exploit scan and an executing emulator for Roblox/Luau places, with measured precision per rule
|
|
5
|
+
License-Expression: FSL-1.1-ALv2
|
|
6
|
+
Project-URL: Source, https://github.com/onyxstaticrbx/onyx-scan
|
|
7
|
+
Project-URL: Issues, https://github.com/onyxstaticrbx/onyx-scan/issues
|
|
8
|
+
Keywords: roblox,luau,static-analysis,security,scanner
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Other
|
|
11
|
+
Classifier: Topic :: Security
|
|
12
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# onyx-scan
|
|
19
|
+
|
|
20
|
+
A static scanner for Roblox/Luau place files, plus an executing emulator that can replay a
|
|
21
|
+
finding's handler under a mock of the documented Roblox API.
|
|
22
|
+
|
|
23
|
+
It is a linter for a narrow class of bug where a client can reach something on the server.
|
|
24
|
+
It is **source-available, not open source** (FSL-1.1-Apache-2.0): read, run and modify it freely,
|
|
25
|
+
including on commercial games; no resale or competing hosted service. It is **not** a security
|
|
26
|
+
audit and not a guarantee.
|
|
27
|
+
|
|
28
|
+
```console
|
|
29
|
+
$ onyx scan examples/demo_addcash_before.rbxlx
|
|
30
|
+
|
|
31
|
+
1 critical issue found in 1 scripts
|
|
32
|
+
1 scripts · 17 lines · 1 client-reachable remotes
|
|
33
|
+
|
|
34
|
+
[CRITICAL] ONYX-L001 game.ServerScriptService.AddCash:14
|
|
35
|
+
Remote handler writes a client-chosen value into a currency value
|
|
36
|
+
Any client can fire this remote with arbitrary arguments. The handler writes a currency value, and the value written comes from the client argument, so a player chooses it.
|
|
37
|
+
check Fire the remote from a client with a wrong type and an extreme value. The value must not move; then repeat with the minimum and maximum you consider legal.
|
|
38
|
+
precision 91.7% (22/24; 95% CI 74.2–97.7%) — Right 22 times out of 24 when a human checked; two did not hold up.
|
|
39
|
+
|
|
40
|
+
[INFO ] ONYX-L016 game.ServerScriptService.AddCash:14
|
|
41
|
+
Client-supplied `amount` is used without a clamp
|
|
42
|
+
`amount` arrives from the client and is never bounded; a client can send a negative or absurd value (e.g. -1e9). Whether that inverts an economy depends on what the write feeds, which this finding names in the snippet.
|
|
43
|
+
check Send NaN, infinity, a negative number and a very large number. The clamp must hold on all four.
|
|
44
|
+
precision no measured rate (not a claim class) — No rate is claimed for this rule.
|
|
45
|
+
|
|
46
|
+
1 critical, 1 info
|
|
47
|
+
|
|
48
|
+
Precision is the author's own measurement (onyx-scan 0.2.2), not an external audit — how to read it, with intervals:
|
|
49
|
+
https://github.com/onyxstaticrbx/onyx-scan#precision
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Every finding also carries a paste-ready fix prompt (`onyx scan --prompt`), the measured
|
|
53
|
+
precision of its rule with the counts and interval, and the check that proves it is closed.
|
|
54
|
+
|
|
55
|
+
Your path, line and rule will differ. A scan is local and makes no network calls; nothing is
|
|
56
|
+
changed, patched, or uploaded.
|
|
57
|
+
|
|
58
|
+
## Install
|
|
59
|
+
|
|
60
|
+
The package installs from PyPI; the two example fixtures live in the repository, so a clone is the
|
|
61
|
+
shortest path to a runnable example:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
git clone https://github.com/onyxstaticrbx/onyx-scan
|
|
65
|
+
cd onyx-scan
|
|
66
|
+
python -m venv .venv
|
|
67
|
+
# Windows: .venv\Scripts\activate macOS/Linux: . .venv/bin/activate
|
|
68
|
+
pip install .
|
|
69
|
+
onyx scan examples/demo_addcash_before.rbxlx
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The two fixtures are small example places, one vulnerable and one fixed, so every command
|
|
73
|
+
below runs against them in a clean virtualenv. If you already have a place file, `pip install
|
|
74
|
+
onyx-scan` alone is enough and `onyx scan your-place.rbxlx` works from any directory.
|
|
75
|
+
|
|
76
|
+
Python 3.10 or newer. The static scan needs only Python.
|
|
77
|
+
|
|
78
|
+
`onyx verify` needs a [Luau](https://github.com/luau-lang/luau/releases) interpreter. The verify
|
|
79
|
+
path is **tested on Linux and WSL 2 (Ubuntu)**. macOS is **untested**; native Windows is **not
|
|
80
|
+
supported** for `verify` and stops with a clear message rather than running without the POSIX
|
|
81
|
+
limits. WSL 1 and other distros are untested. It uses POSIX process limits for untrusted code;
|
|
82
|
+
on native Windows it stops with a clear "not supported, use WSL 2 (Ubuntu)" message. On Linux or
|
|
83
|
+
WSL 2 (Ubuntu), put `luau` on `PATH`, pass `--luau /path/to/luau`, or set `ONYX_LUAU`. Without an
|
|
84
|
+
interpreter, `onyx scan` still works and `onyx verify` stops with a clear install message instead
|
|
85
|
+
of pretending to have executed anything.
|
|
86
|
+
|
|
87
|
+
## What it catches
|
|
88
|
+
|
|
89
|
+
Specific shapes where a client can reach server state: a value written into currency or
|
|
90
|
+
attributes, an external module loaded by a numeric asset id, purchase and remote handling that
|
|
91
|
+
trusts the wrong side, and saved-data key handling. Every finding names the file and line and
|
|
92
|
+
says what the client controls.
|
|
93
|
+
|
|
94
|
+
Where there is enough evidence, the report carries the measured precision of the rule **with its
|
|
95
|
+
counts and 95% interval** (for example `63.6% (7/11; 95% CI 35.4–84.8%)`, marked a lead, not a
|
|
96
|
+
conclusion); where there is not, it says `underpowered — N checked` or `no measured rate` rather
|
|
97
|
+
than quoting a number. The rule id on every finding is stable, so a finding can be matched across
|
|
98
|
+
runs and reports; the labels are frozen for `onyx-scan 0.2.2`: this is the author's own
|
|
99
|
+
self-assessment, not an external audit, and the Precision section below shows how to read them.
|
|
100
|
+
|
|
101
|
+
Some findings are informational notes for rules the precision table does not measure; those print
|
|
102
|
+
`no measured rate` in the same line rather than silently omitting it.
|
|
103
|
+
|
|
104
|
+
## Precision
|
|
105
|
+
|
|
106
|
+
The measured labels are the author's self-assessment — findings read by hand, not an external
|
|
107
|
+
audit. Each measured rate shows the checked count and its 95% interval; no point estimate is
|
|
108
|
+
printed alone. A rule with too few checked findings says `underpowered — N checked`; a rule with
|
|
109
|
+
none says `no measured rate`. A finding's `ONYX-L***` code identifies the rule whose
|
|
110
|
+
measured label applies.
|
|
111
|
+
|
|
112
|
+
## What it does not catch
|
|
113
|
+
|
|
114
|
+
- duplication and race-condition bugs (two players acting on the same tick);
|
|
115
|
+
- client-trusted combat, damage or position;
|
|
116
|
+
- movement exploits, and anything that lives only inside Roblox's own client;
|
|
117
|
+
- anything outside those rule classes.
|
|
118
|
+
|
|
119
|
+
**Zero findings means those shapes were searched for and not found — it is not a statement
|
|
120
|
+
that your game is secure.**
|
|
121
|
+
|
|
122
|
+
## Verify (optional)
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
onyx verify examples/demo_addcash_before.rbxlx
|
|
126
|
+
onyx verify examples/demo_addcash_before.rbxlx --fail-on-confirmed # exits 2 if confirmed
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Runs the handlers under a mock of the documented Roblox API and records evidence: how many
|
|
130
|
+
client-shaped payloads were fired (counted by the engine, not typed in), and every before/after
|
|
131
|
+
move of the state a handler wrote. It is a mock, not a live game server, and the report says so.
|
|
132
|
+
`onyx verify --fail-on-confirmed` exits 2 when an exploit is confirmed, for CI.
|
|
133
|
+
|
|
134
|
+
## CI and baselines
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
onyx scan examples/demo_addcash_before.rbxlx --json out.json # machine-readable report
|
|
138
|
+
onyx baseline examples/demo_addcash_before.rbxlx -o .onyx-baseline.json
|
|
139
|
+
onyx scan examples/demo_addcash_before.rbxlx --baseline .onyx-baseline.json --fail-on-new
|
|
140
|
+
onyx scan examples/demo_addcash_before.rbxlx --prompt # paste-ready fix prompts
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`--fail-on-critical` is also available for a quick gate. `onyx verify --fail-on-confirmed`
|
|
144
|
+
exits 2 when it confirms an exploit, so both halves can gate CI.
|
|
145
|
+
|
|
146
|
+
## Formats
|
|
147
|
+
|
|
148
|
+
`.rbxlx` (place) and `.rbxmx` (model) are the supported formats. A file saved as XML but named
|
|
149
|
+
`.rbxl` or `.rbxm` is read too. A **binary** `.rbxl` cannot be read; export it in Studio via
|
|
150
|
+
*File → Save to File As…*, then pick **Roblox XML Place Files (`*.rbxlx`)** under *Save as type*.
|
|
151
|
+
In Team Create, save **File → Download a Copy** first, open that copy, then save it as XML. Rojo
|
|
152
|
+
project folders of plain `.lua`/`.luau` files are not scanned.
|
|
153
|
+
|
|
154
|
+
## FAQ
|
|
155
|
+
|
|
156
|
+
**Does it change my game?** No. It reads a file and prints findings. Nothing is applied.
|
|
157
|
+
|
|
158
|
+
**Does my file leave my computer?** No. The tool makes no network calls, and the file never
|
|
159
|
+
leaves your computer.
|
|
160
|
+
|
|
161
|
+
**What does "0 findings" mean?** Those specific shapes were searched for and not found. It
|
|
162
|
+
does not mean secure.
|
|
163
|
+
|
|
164
|
+
**`onyx rules`?** Lists every rule id and what it catches, so a finding's `ONYX-L***` code can be
|
|
165
|
+
looked up by rule id.
|
|
166
|
+
|
|
167
|
+
**What if a finding is wrong?** Open a *wrong finding* issue with the rule id, path:line and
|
|
168
|
+
one sentence. That is how the rules get better. Please don't post your place file or any
|
|
169
|
+
credentials.
|
|
170
|
+
|
|
171
|
+
**Windows?** `onyx scan` works on Windows with Python 3.10+ from python.org; it has been tested
|
|
172
|
+
by the maintainer on Windows. `onyx verify` is **not supported on native Windows yet**: it executes
|
|
173
|
+
untrusted place code and needs POSIX CPU, memory and file-size limits, so this build refuses instead
|
|
174
|
+
of running without them. `onyx verify` is tested on Linux and WSL 2 (Ubuntu); macOS is untested.
|
|
175
|
+
WSL 1 and other distros are untested. The Windows commands are:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
py -m pip install onyx-scan
|
|
179
|
+
py -m onyx.cli scan place.rbxlx
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Licence
|
|
183
|
+
|
|
184
|
+
**Functional Source License 1.1, Apache 2.0 Future License (FSL-1.1-Apache-2.0).** Source-available,
|
|
185
|
+
not open source. You may read, run, modify and share the code for any purpose except a competing
|
|
186
|
+
use — commercially scanning your own games is allowed. After two years from each version's release,
|
|
187
|
+
that version becomes available under Apache 2.0. The full canonical text is in `LICENSE`.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# onyx-scan
|
|
2
|
+
|
|
3
|
+
A static scanner for Roblox/Luau place files, plus an executing emulator that can replay a
|
|
4
|
+
finding's handler under a mock of the documented Roblox API.
|
|
5
|
+
|
|
6
|
+
It is a linter for a narrow class of bug where a client can reach something on the server.
|
|
7
|
+
It is **source-available, not open source** (FSL-1.1-Apache-2.0): read, run and modify it freely,
|
|
8
|
+
including on commercial games; no resale or competing hosted service. It is **not** a security
|
|
9
|
+
audit and not a guarantee.
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
$ onyx scan examples/demo_addcash_before.rbxlx
|
|
13
|
+
|
|
14
|
+
1 critical issue found in 1 scripts
|
|
15
|
+
1 scripts · 17 lines · 1 client-reachable remotes
|
|
16
|
+
|
|
17
|
+
[CRITICAL] ONYX-L001 game.ServerScriptService.AddCash:14
|
|
18
|
+
Remote handler writes a client-chosen value into a currency value
|
|
19
|
+
Any client can fire this remote with arbitrary arguments. The handler writes a currency value, and the value written comes from the client argument, so a player chooses it.
|
|
20
|
+
check Fire the remote from a client with a wrong type and an extreme value. The value must not move; then repeat with the minimum and maximum you consider legal.
|
|
21
|
+
precision 91.7% (22/24; 95% CI 74.2–97.7%) — Right 22 times out of 24 when a human checked; two did not hold up.
|
|
22
|
+
|
|
23
|
+
[INFO ] ONYX-L016 game.ServerScriptService.AddCash:14
|
|
24
|
+
Client-supplied `amount` is used without a clamp
|
|
25
|
+
`amount` arrives from the client and is never bounded; a client can send a negative or absurd value (e.g. -1e9). Whether that inverts an economy depends on what the write feeds, which this finding names in the snippet.
|
|
26
|
+
check Send NaN, infinity, a negative number and a very large number. The clamp must hold on all four.
|
|
27
|
+
precision no measured rate (not a claim class) — No rate is claimed for this rule.
|
|
28
|
+
|
|
29
|
+
1 critical, 1 info
|
|
30
|
+
|
|
31
|
+
Precision is the author's own measurement (onyx-scan 0.2.2), not an external audit — how to read it, with intervals:
|
|
32
|
+
https://github.com/onyxstaticrbx/onyx-scan#precision
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Every finding also carries a paste-ready fix prompt (`onyx scan --prompt`), the measured
|
|
36
|
+
precision of its rule with the counts and interval, and the check that proves it is closed.
|
|
37
|
+
|
|
38
|
+
Your path, line and rule will differ. A scan is local and makes no network calls; nothing is
|
|
39
|
+
changed, patched, or uploaded.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
The package installs from PyPI; the two example fixtures live in the repository, so a clone is the
|
|
44
|
+
shortest path to a runnable example:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
git clone https://github.com/onyxstaticrbx/onyx-scan
|
|
48
|
+
cd onyx-scan
|
|
49
|
+
python -m venv .venv
|
|
50
|
+
# Windows: .venv\Scripts\activate macOS/Linux: . .venv/bin/activate
|
|
51
|
+
pip install .
|
|
52
|
+
onyx scan examples/demo_addcash_before.rbxlx
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The two fixtures are small example places, one vulnerable and one fixed, so every command
|
|
56
|
+
below runs against them in a clean virtualenv. If you already have a place file, `pip install
|
|
57
|
+
onyx-scan` alone is enough and `onyx scan your-place.rbxlx` works from any directory.
|
|
58
|
+
|
|
59
|
+
Python 3.10 or newer. The static scan needs only Python.
|
|
60
|
+
|
|
61
|
+
`onyx verify` needs a [Luau](https://github.com/luau-lang/luau/releases) interpreter. The verify
|
|
62
|
+
path is **tested on Linux and WSL 2 (Ubuntu)**. macOS is **untested**; native Windows is **not
|
|
63
|
+
supported** for `verify` and stops with a clear message rather than running without the POSIX
|
|
64
|
+
limits. WSL 1 and other distros are untested. It uses POSIX process limits for untrusted code;
|
|
65
|
+
on native Windows it stops with a clear "not supported, use WSL 2 (Ubuntu)" message. On Linux or
|
|
66
|
+
WSL 2 (Ubuntu), put `luau` on `PATH`, pass `--luau /path/to/luau`, or set `ONYX_LUAU`. Without an
|
|
67
|
+
interpreter, `onyx scan` still works and `onyx verify` stops with a clear install message instead
|
|
68
|
+
of pretending to have executed anything.
|
|
69
|
+
|
|
70
|
+
## What it catches
|
|
71
|
+
|
|
72
|
+
Specific shapes where a client can reach server state: a value written into currency or
|
|
73
|
+
attributes, an external module loaded by a numeric asset id, purchase and remote handling that
|
|
74
|
+
trusts the wrong side, and saved-data key handling. Every finding names the file and line and
|
|
75
|
+
says what the client controls.
|
|
76
|
+
|
|
77
|
+
Where there is enough evidence, the report carries the measured precision of the rule **with its
|
|
78
|
+
counts and 95% interval** (for example `63.6% (7/11; 95% CI 35.4–84.8%)`, marked a lead, not a
|
|
79
|
+
conclusion); where there is not, it says `underpowered — N checked` or `no measured rate` rather
|
|
80
|
+
than quoting a number. The rule id on every finding is stable, so a finding can be matched across
|
|
81
|
+
runs and reports; the labels are frozen for `onyx-scan 0.2.2`: this is the author's own
|
|
82
|
+
self-assessment, not an external audit, and the Precision section below shows how to read them.
|
|
83
|
+
|
|
84
|
+
Some findings are informational notes for rules the precision table does not measure; those print
|
|
85
|
+
`no measured rate` in the same line rather than silently omitting it.
|
|
86
|
+
|
|
87
|
+
## Precision
|
|
88
|
+
|
|
89
|
+
The measured labels are the author's self-assessment — findings read by hand, not an external
|
|
90
|
+
audit. Each measured rate shows the checked count and its 95% interval; no point estimate is
|
|
91
|
+
printed alone. A rule with too few checked findings says `underpowered — N checked`; a rule with
|
|
92
|
+
none says `no measured rate`. A finding's `ONYX-L***` code identifies the rule whose
|
|
93
|
+
measured label applies.
|
|
94
|
+
|
|
95
|
+
## What it does not catch
|
|
96
|
+
|
|
97
|
+
- duplication and race-condition bugs (two players acting on the same tick);
|
|
98
|
+
- client-trusted combat, damage or position;
|
|
99
|
+
- movement exploits, and anything that lives only inside Roblox's own client;
|
|
100
|
+
- anything outside those rule classes.
|
|
101
|
+
|
|
102
|
+
**Zero findings means those shapes were searched for and not found — it is not a statement
|
|
103
|
+
that your game is secure.**
|
|
104
|
+
|
|
105
|
+
## Verify (optional)
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
onyx verify examples/demo_addcash_before.rbxlx
|
|
109
|
+
onyx verify examples/demo_addcash_before.rbxlx --fail-on-confirmed # exits 2 if confirmed
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Runs the handlers under a mock of the documented Roblox API and records evidence: how many
|
|
113
|
+
client-shaped payloads were fired (counted by the engine, not typed in), and every before/after
|
|
114
|
+
move of the state a handler wrote. It is a mock, not a live game server, and the report says so.
|
|
115
|
+
`onyx verify --fail-on-confirmed` exits 2 when an exploit is confirmed, for CI.
|
|
116
|
+
|
|
117
|
+
## CI and baselines
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
onyx scan examples/demo_addcash_before.rbxlx --json out.json # machine-readable report
|
|
121
|
+
onyx baseline examples/demo_addcash_before.rbxlx -o .onyx-baseline.json
|
|
122
|
+
onyx scan examples/demo_addcash_before.rbxlx --baseline .onyx-baseline.json --fail-on-new
|
|
123
|
+
onyx scan examples/demo_addcash_before.rbxlx --prompt # paste-ready fix prompts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`--fail-on-critical` is also available for a quick gate. `onyx verify --fail-on-confirmed`
|
|
127
|
+
exits 2 when it confirms an exploit, so both halves can gate CI.
|
|
128
|
+
|
|
129
|
+
## Formats
|
|
130
|
+
|
|
131
|
+
`.rbxlx` (place) and `.rbxmx` (model) are the supported formats. A file saved as XML but named
|
|
132
|
+
`.rbxl` or `.rbxm` is read too. A **binary** `.rbxl` cannot be read; export it in Studio via
|
|
133
|
+
*File → Save to File As…*, then pick **Roblox XML Place Files (`*.rbxlx`)** under *Save as type*.
|
|
134
|
+
In Team Create, save **File → Download a Copy** first, open that copy, then save it as XML. Rojo
|
|
135
|
+
project folders of plain `.lua`/`.luau` files are not scanned.
|
|
136
|
+
|
|
137
|
+
## FAQ
|
|
138
|
+
|
|
139
|
+
**Does it change my game?** No. It reads a file and prints findings. Nothing is applied.
|
|
140
|
+
|
|
141
|
+
**Does my file leave my computer?** No. The tool makes no network calls, and the file never
|
|
142
|
+
leaves your computer.
|
|
143
|
+
|
|
144
|
+
**What does "0 findings" mean?** Those specific shapes were searched for and not found. It
|
|
145
|
+
does not mean secure.
|
|
146
|
+
|
|
147
|
+
**`onyx rules`?** Lists every rule id and what it catches, so a finding's `ONYX-L***` code can be
|
|
148
|
+
looked up by rule id.
|
|
149
|
+
|
|
150
|
+
**What if a finding is wrong?** Open a *wrong finding* issue with the rule id, path:line and
|
|
151
|
+
one sentence. That is how the rules get better. Please don't post your place file or any
|
|
152
|
+
credentials.
|
|
153
|
+
|
|
154
|
+
**Windows?** `onyx scan` works on Windows with Python 3.10+ from python.org; it has been tested
|
|
155
|
+
by the maintainer on Windows. `onyx verify` is **not supported on native Windows yet**: it executes
|
|
156
|
+
untrusted place code and needs POSIX CPU, memory and file-size limits, so this build refuses instead
|
|
157
|
+
of running without them. `onyx verify` is tested on Linux and WSL 2 (Ubuntu); macOS is untested.
|
|
158
|
+
WSL 1 and other distros are untested. The Windows commands are:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
py -m pip install onyx-scan
|
|
162
|
+
py -m onyx.cli scan place.rbxlx
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Licence
|
|
166
|
+
|
|
167
|
+
**Functional Source License 1.1, Apache 2.0 Future License (FSL-1.1-Apache-2.0).** Source-available,
|
|
168
|
+
not open source. You may read, run, modify and share the code for any purpose except a competing
|
|
169
|
+
use — commercially scanning your own games is allowed. After two years from each version's release,
|
|
170
|
+
that version becomes available under Apache 2.0. The full canonical text is in `LICENSE`.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# onyx-scan
|
|
2
|
+
|
|
3
|
+
A static scanner for Roblox/Luau place files, plus an executing emulator that can replay a
|
|
4
|
+
finding's handler under a mock of the documented Roblox API.
|
|
5
|
+
|
|
6
|
+
It is a linter for a narrow class of bug where a client can reach something on the server.
|
|
7
|
+
It is **source-available, not open source** (FSL-1.1-Apache-2.0): read, run and modify it freely,
|
|
8
|
+
including on commercial games; no resale or competing hosted service. It is **not** a security
|
|
9
|
+
audit and not a guarantee.
|
|
10
|
+
|
|
11
|
+
```console
|
|
12
|
+
$ onyx scan examples/demo_addcash_before.rbxlx
|
|
13
|
+
|
|
14
|
+
1 critical issue found in 1 scripts
|
|
15
|
+
1 scripts · 17 lines · 1 client-reachable remotes
|
|
16
|
+
|
|
17
|
+
[CRITICAL] ONYX-L001 game.ServerScriptService.AddCash:14
|
|
18
|
+
Remote handler writes a client-chosen value into a currency value
|
|
19
|
+
Any client can fire this remote with arbitrary arguments. The handler writes a currency value, and the value written comes from the client argument, so a player chooses it.
|
|
20
|
+
check Fire the remote from a client with a wrong type and an extreme value. The value must not move; then repeat with the minimum and maximum you consider legal.
|
|
21
|
+
precision 91.7% (22/24; 95% CI 74.2–97.7%) — Right 22 times out of 24 when a human checked; two did not hold up.
|
|
22
|
+
|
|
23
|
+
[INFO ] ONYX-L016 game.ServerScriptService.AddCash:14
|
|
24
|
+
Client-supplied `amount` is used without a clamp
|
|
25
|
+
`amount` arrives from the client and is never bounded; a client can send a negative or absurd value (e.g. -1e9). Whether that inverts an economy depends on what the write feeds, which this finding names in the snippet.
|
|
26
|
+
check Send NaN, infinity, a negative number and a very large number. The clamp must hold on all four.
|
|
27
|
+
precision no measured rate (not a claim class) — No rate is claimed for this rule.
|
|
28
|
+
|
|
29
|
+
1 critical, 1 info
|
|
30
|
+
|
|
31
|
+
Precision is the author's own measurement (onyx-scan 0.2.2), not an external audit — how to read it, with intervals:
|
|
32
|
+
https://github.com/onyxstaticrbx/onyx-scan#precision
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Every finding also carries a paste-ready fix prompt (`onyx scan --prompt`), the measured
|
|
36
|
+
precision of its rule with the counts and interval, and the check that proves it is closed.
|
|
37
|
+
|
|
38
|
+
Your path, line and rule will differ. A scan is local and makes no network calls; nothing is
|
|
39
|
+
changed, patched, or uploaded.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
The package installs from PyPI; the two example fixtures live in the repository, so a clone is the
|
|
44
|
+
shortest path to a runnable example:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
git clone https://github.com/onyxstaticrbx/onyx-scan
|
|
48
|
+
cd onyx-scan
|
|
49
|
+
python -m venv .venv
|
|
50
|
+
# Windows: .venv\Scripts\activate macOS/Linux: . .venv/bin/activate
|
|
51
|
+
pip install .
|
|
52
|
+
onyx scan examples/demo_addcash_before.rbxlx
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The two fixtures are small example places, one vulnerable and one fixed, so every command
|
|
56
|
+
below runs against them in a clean virtualenv. If you already have a place file, `pip install
|
|
57
|
+
onyx-scan` alone is enough and `onyx scan your-place.rbxlx` works from any directory.
|
|
58
|
+
|
|
59
|
+
Python 3.10 or newer. The static scan needs only Python.
|
|
60
|
+
|
|
61
|
+
`onyx verify` needs a [Luau](https://github.com/luau-lang/luau/releases) interpreter. The verify
|
|
62
|
+
path is **tested on Linux and WSL 2 (Ubuntu)**. macOS is **untested**; native Windows is **not
|
|
63
|
+
supported** for `verify` and stops with a clear message rather than running without the POSIX
|
|
64
|
+
limits. WSL 1 and other distros are untested. It uses POSIX process limits for untrusted code;
|
|
65
|
+
on native Windows it stops with a clear "not supported, use WSL 2 (Ubuntu)" message. On Linux or
|
|
66
|
+
WSL 2 (Ubuntu), put `luau` on `PATH`, pass `--luau /path/to/luau`, or set `ONYX_LUAU`. Without an
|
|
67
|
+
interpreter, `onyx scan` still works and `onyx verify` stops with a clear install message instead
|
|
68
|
+
of pretending to have executed anything.
|
|
69
|
+
|
|
70
|
+
## What it catches
|
|
71
|
+
|
|
72
|
+
Specific shapes where a client can reach server state: a value written into currency or
|
|
73
|
+
attributes, an external module loaded by a numeric asset id, purchase and remote handling that
|
|
74
|
+
trusts the wrong side, and saved-data key handling. Every finding names the file and line and
|
|
75
|
+
says what the client controls.
|
|
76
|
+
|
|
77
|
+
Where there is enough evidence, the report carries the measured precision of the rule **with its
|
|
78
|
+
counts and 95% interval** (for example `63.6% (7/11; 95% CI 35.4–84.8%)`, marked a lead, not a
|
|
79
|
+
conclusion); where there is not, it says `underpowered — N checked` or `no measured rate` rather
|
|
80
|
+
than quoting a number. The rule id on every finding is stable, so a finding can be matched across
|
|
81
|
+
runs and reports; the labels are frozen for `onyx-scan 0.2.2`: this is the author's own
|
|
82
|
+
self-assessment, not an external audit, and the Precision section below shows how to read them.
|
|
83
|
+
|
|
84
|
+
Some findings are informational notes for rules the precision table does not measure; those print
|
|
85
|
+
`no measured rate` in the same line rather than silently omitting it.
|
|
86
|
+
|
|
87
|
+
## Precision
|
|
88
|
+
|
|
89
|
+
The measured labels are the author's self-assessment — findings read by hand, not an external
|
|
90
|
+
audit. Each measured rate shows the checked count and its 95% interval; no point estimate is
|
|
91
|
+
printed alone. A rule with too few checked findings says `underpowered — N checked`; a rule with
|
|
92
|
+
none says `no measured rate`. A finding's `ONYX-L***` code identifies the rule whose
|
|
93
|
+
measured label applies.
|
|
94
|
+
|
|
95
|
+
## What it does not catch
|
|
96
|
+
|
|
97
|
+
- duplication and race-condition bugs (two players acting on the same tick);
|
|
98
|
+
- client-trusted combat, damage or position;
|
|
99
|
+
- movement exploits, and anything that lives only inside Roblox's own client;
|
|
100
|
+
- anything outside those rule classes.
|
|
101
|
+
|
|
102
|
+
**Zero findings means those shapes were searched for and not found — it is not a statement
|
|
103
|
+
that your game is secure.**
|
|
104
|
+
|
|
105
|
+
## Verify (optional)
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
onyx verify examples/demo_addcash_before.rbxlx
|
|
109
|
+
onyx verify examples/demo_addcash_before.rbxlx --fail-on-confirmed # exits 2 if confirmed
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Runs the handlers under a mock of the documented Roblox API and records evidence: how many
|
|
113
|
+
client-shaped payloads were fired (counted by the engine, not typed in), and every before/after
|
|
114
|
+
move of the state a handler wrote. It is a mock, not a live game server, and the report says so.
|
|
115
|
+
`onyx verify --fail-on-confirmed` exits 2 when an exploit is confirmed, for CI.
|
|
116
|
+
|
|
117
|
+
## CI and baselines
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
onyx scan examples/demo_addcash_before.rbxlx --json out.json # machine-readable report
|
|
121
|
+
onyx baseline examples/demo_addcash_before.rbxlx -o .onyx-baseline.json
|
|
122
|
+
onyx scan examples/demo_addcash_before.rbxlx --baseline .onyx-baseline.json --fail-on-new
|
|
123
|
+
onyx scan examples/demo_addcash_before.rbxlx --prompt # paste-ready fix prompts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
`--fail-on-critical` is also available for a quick gate. `onyx verify --fail-on-confirmed`
|
|
127
|
+
exits 2 when it confirms an exploit, so both halves can gate CI.
|
|
128
|
+
|
|
129
|
+
## Formats
|
|
130
|
+
|
|
131
|
+
`.rbxlx` (place) and `.rbxmx` (model) are the supported formats. A file saved as XML but named
|
|
132
|
+
`.rbxl` or `.rbxm` is read too. A **binary** `.rbxl` cannot be read; export it in Studio via
|
|
133
|
+
*File → Save to File As…*, then pick **Roblox XML Place Files (`*.rbxlx`)** under *Save as type*.
|
|
134
|
+
In Team Create, save **File → Download a Copy** first, open that copy, then save it as XML. Rojo
|
|
135
|
+
project folders of plain `.lua`/`.luau` files are not scanned.
|
|
136
|
+
|
|
137
|
+
## FAQ
|
|
138
|
+
|
|
139
|
+
**Does it change my game?** No. It reads a file and prints findings. Nothing is applied.
|
|
140
|
+
|
|
141
|
+
**Does my file leave my computer?** No. The tool makes no network calls, and the file never
|
|
142
|
+
leaves your computer.
|
|
143
|
+
|
|
144
|
+
**What does "0 findings" mean?** Those specific shapes were searched for and not found. It
|
|
145
|
+
does not mean secure.
|
|
146
|
+
|
|
147
|
+
**`onyx rules`?** Lists every rule id and what it catches, so a finding's `ONYX-L***` code can be
|
|
148
|
+
looked up by rule id.
|
|
149
|
+
|
|
150
|
+
**What if a finding is wrong?** Open a *wrong finding* issue with the rule id, path:line and
|
|
151
|
+
one sentence. That is how the rules get better. Please don't post your place file or any
|
|
152
|
+
credentials.
|
|
153
|
+
|
|
154
|
+
**Windows?** `onyx scan` works on Windows with Python 3.10+ from python.org; it has been tested
|
|
155
|
+
by the maintainer on Windows. `onyx verify` is **not supported on native Windows yet**: it executes
|
|
156
|
+
untrusted place code and needs POSIX CPU, memory and file-size limits, so this build refuses instead
|
|
157
|
+
of running without them. `onyx verify` is tested on Linux and WSL 2 (Ubuntu); macOS is untested.
|
|
158
|
+
WSL 1 and other distros are untested. The Windows commands are:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
py -m pip install onyx-scan
|
|
162
|
+
py -m onyx.cli scan place.rbxlx
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Licence
|
|
166
|
+
|
|
167
|
+
**Functional Source License 1.1, Apache 2.0 Future License (FSL-1.1-Apache-2.0).** Source-available,
|
|
168
|
+
not open source. You may read, run, modify and share the code for any purpose except a competing
|
|
169
|
+
use — commercially scanning your own games is allowed. After two years from each version's release,
|
|
170
|
+
that version becomes available under Apache 2.0. The full canonical text is in `LICENSE`.
|
|
File without changes
|