openqodex 0.1.0

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.
Files changed (90) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +35 -0
  3. package/README.md +160 -0
  4. package/demo/baseline/.github/workflows/ci.yml +18 -0
  5. package/demo/baseline/Dockerfile +12 -0
  6. package/demo/baseline/app/__init__.py +0 -0
  7. package/demo/baseline/app/server.py +37 -0
  8. package/demo/baseline/package-lock.json +21 -0
  9. package/demo/baseline/package.json +9 -0
  10. package/demo/baseline/requirements.txt +1 -0
  11. package/demo/baseline/scripts/deploy.sh +13 -0
  12. package/demo/expected.json +126 -0
  13. package/demo/planted/.github/workflows/ci.yml +20 -0
  14. package/demo/planted/Dockerfile +11 -0
  15. package/demo/planted/app/config.py +3 -0
  16. package/demo/planted/app/search.py +17 -0
  17. package/demo/planted/app/server.py +40 -0
  18. package/demo/planted/package-lock.json +21 -0
  19. package/demo/planted/package.json +9 -0
  20. package/demo/planted/scripts/deploy.sh +13 -0
  21. package/dist/bin.js +42546 -0
  22. package/docs/agents.md +121 -0
  23. package/docs/cli.md +161 -0
  24. package/docs/config.md +165 -0
  25. package/docs/custom-scanners.md +164 -0
  26. package/docs/faq.md +54 -0
  27. package/docs/github-action.md +73 -0
  28. package/docs/index.md +29 -0
  29. package/docs/llms.txt +13 -0
  30. package/docs/quickstart.md +82 -0
  31. package/docs/scanners.md +148 -0
  32. package/docs/security.md +74 -0
  33. package/docs/telemetry.md +9 -0
  34. package/lenses/a11y-icon-only-button-no-aria-label.md +51 -0
  35. package/lenses/array-iteration-missing-key-prop.md +31 -0
  36. package/lenses/async-await-in-loop-n-plus-one.md +42 -0
  37. package/lenses/async-click-double-fire-race.md +59 -0
  38. package/lenses/async-floating-promise.md +40 -0
  39. package/lenses/async-promise-all-swallows-errors.md +42 -0
  40. package/lenses/async-unhandled-rejection-in-handler.md +42 -0
  41. package/lenses/auth-missing-on-state-change-route.md +60 -0
  42. package/lenses/auth-role-from-user-input.md +49 -0
  43. package/lenses/auth-timing-attack-password-compare.md +59 -0
  44. package/lenses/cookie-missing-secure-httponly.md +46 -0
  45. package/lenses/cors-wildcard-with-credentials.md +47 -0
  46. package/lenses/crypto-jwt-verify-without-algo-allowlist.md +41 -0
  47. package/lenses/crypto-math-random-for-tokens.md +53 -0
  48. package/lenses/crypto-md5-sha1-for-secrets.md +60 -0
  49. package/lenses/env-vars-read-at-module-top.md +42 -0
  50. package/lenses/eval-on-user-input.md +51 -0
  51. package/lenses/fetch-without-timeout.md +41 -0
  52. package/lenses/id-enumeration-sequential.md +49 -0
  53. package/lenses/interactive-state-decoupled-from-output.md +67 -0
  54. package/lenses/json-parse-no-try-catch.md +41 -0
  55. package/lenses/missing-rate-limit-on-auth.md +49 -0
  56. package/lenses/oauth-scope-wider-than-use.md +79 -0
  57. package/lenses/object-spread-clobber.md +44 -0
  58. package/lenses/open-redirect-from-untrusted-host.md +55 -0
  59. package/lenses/orm-drizzle-on-conflict-clobber.md +47 -0
  60. package/lenses/path-traversal-in-fs-access.md +59 -0
  61. package/lenses/pii-in-url-or-log.md +48 -0
  62. package/lenses/race-check-then-act.md +49 -0
  63. package/lenses/react-dangerously-set-inner-html.md +32 -0
  64. package/lenses/react-fetch-in-effect-without-abort.md +31 -0
  65. package/lenses/react-stale-closure-in-callback.md +28 -0
  66. package/lenses/react-state-set-in-render.md +33 -0
  67. package/lenses/react-use-effect-missing-cleanup.md +29 -0
  68. package/lenses/react-use-effect-missing-deps.md +30 -0
  69. package/lenses/regexp-from-user-input.md +43 -0
  70. package/lenses/return-shape-contract-break.md +71 -0
  71. package/lenses/secrets-logged-in-error-path.md +60 -0
  72. package/lenses/sql-migration-references-later-object.md +47 -0
  73. package/lenses/sql-string-concatenation.md +63 -0
  74. package/lenses/ssrf-server-side-fetch.md +69 -0
  75. package/lenses/supabase-comment-on-function-unqualified.md +37 -0
  76. package/lenses/supabase-function-default-public-execute.md +50 -0
  77. package/lenses/supabase-security-definer-no-search-path.md +34 -0
  78. package/lenses/supabase-single-500-on-no-match.md +65 -0
  79. package/lenses/upsert-state-column.md +57 -0
  80. package/lenses/url-not-encoded-for-user-id.md +78 -0
  81. package/lenses/use-state-default-not-functional.md +30 -0
  82. package/package.json +57 -0
  83. package/skills/openqodex/SKILL.md +141 -0
  84. package/templates/README.md +67 -0
  85. package/templates/claude-code/settings-hook.json +16 -0
  86. package/templates/cline/openqodex.md +9 -0
  87. package/templates/codex/AGENTS-section.md +8 -0
  88. package/templates/codex/hooks.json +16 -0
  89. package/templates/cursor/openqodex.mdc +15 -0
  90. package/toolchain.json +345 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,35 @@
1
+ OpenQodex
2
+ Copyright 2026 The OpenQodex Authors
3
+
4
+ This product is licensed under the Apache License, Version 2.0. See LICENSE.
5
+
6
+ Scanners
7
+
8
+ OpenQodex does not include any scanner. It downloads each scanner at run
9
+ time onto the user's machine, from the scanner's own release or package
10
+ registry. Each scanner keeps its own licence:
11
+
12
+ - semgrep, LGPL-2.1: https://github.com/semgrep/semgrep
13
+ - gitleaks, MIT: https://github.com/gitleaks/gitleaks
14
+ - bandit, Apache-2.0: https://github.com/PyCQA/bandit
15
+ - ruff, MIT: https://github.com/astral-sh/ruff
16
+ - oxlint, MIT: https://github.com/oxc-project/oxc
17
+ - osv-scanner, Apache-2.0: https://github.com/google/osv-scanner
18
+ - actionlint, MIT: https://github.com/rhysd/actionlint
19
+ - hadolint, GPL-3.0: https://github.com/hadolint/hadolint
20
+ - shellcheck, GPL-3.0: https://github.com/koalaman/shellcheck
21
+ - golangci-lint, GPL-3.0: https://github.com/golangci/golangci-lint
22
+ - brakeman, Brakeman Public Use License: https://github.com/presidentbeef/brakeman
23
+ This is not an open source licence. OpenQodex does not bundle brakeman.
24
+ It downloads brakeman at run time onto the user's machine.
25
+ - rubocop, MIT: https://github.com/rubocop/rubocop
26
+ - rubocop-rails, MIT: https://github.com/rubocop/rubocop-rails
27
+ - rubocop-performance, MIT: https://github.com/rubocop/rubocop-performance
28
+ - uv, Apache-2.0 or MIT: https://github.com/astral-sh/uv
29
+
30
+ Semgrep rules
31
+
32
+ semgrep fetches its rule packs from the Semgrep registry at run time, onto
33
+ the user's machine, for the user's own code. The rules are licensed under
34
+ the Semgrep Rules License v1.0: https://semgrep.dev/legal/rules-license
35
+ OpenQodex never bundles, vendors or redistributes them.
package/README.md ADDED
@@ -0,0 +1,160 @@
1
+ <!-- banner: added before launch -->
2
+
3
+ # OpenQodex
4
+
5
+ [![npm version](https://img.shields.io/npm/v/openqodex)](https://www.npmjs.com/package/openqodex)
6
+ [![licence](https://img.shields.io/badge/licence-Apache--2.0-blue)](LICENSE)
7
+ [![CI](https://github.com/openqodex/openqodex/actions/workflows/ci.yml/badge.svg)](https://github.com/openqodex/openqodex/actions/workflows/ci.yml)
8
+
9
+ OpenQodex is open source code review that runs inside your coding agent, before you push. It works out your change: the commits not yet pushed plus everything uncommitted. It runs the scanners that fit the changed files and keeps only findings on the lines you changed. Your agent then reviews the change on its own model and writes its findings in a fixed shape. OpenQodex checks those findings without a model and writes the report. It needs no key, no account and no server.
10
+
11
+ ## Install
12
+
13
+ For humans, in your terminal:
14
+
15
+ ```
16
+ npx openqodex init
17
+ ```
18
+
19
+ `init` finds Claude Code, Cursor, Codex CLI and Cline on your machine. It prints every file it will write and asks once. Then say to your agent: "review my change with openqodex".
20
+
21
+ For agents:
22
+
23
+ ```
24
+ npx skills add openqodex/openqodex
25
+ ```
26
+
27
+ Or paste this prompt into your agent:
28
+
29
+ ```
30
+ Install the OpenQodex skill with `npx skills add openqodex/openqodex`.
31
+ Then review my current change with openqodex and tell me the verdict and the findings.
32
+ ```
33
+
34
+ OpenQodex needs Node 22 or newer and git. It runs on macOS and Linux. On Windows, use WSL.
35
+
36
+ <!-- recording: added before launch -->
37
+
38
+ ## What it does today
39
+
40
+ - `openqodex review --agent` writes a review brief for your agent: the scanner findings to verify, review patterns that fit the change, and the diff.
41
+ - `openqodex review --finalize` checks the agent's findings without a model and writes `report.md`, `report.json` and `report.sarif`.
42
+ - `openqodex scan` runs the scanners only, for git hooks, pre-commit and CI.
43
+ - Thirteen built-in scanners. Every downloaded scanner is pinned to one version. Each runs only when the change holds a file it reads.
44
+ - Any scanner by its GitHub link, after you approve it with `openqodex trust`.
45
+ - A push gate for Claude Code and Codex. It warns by default. It blocks only when `.openqodex.yaml` sets `review.block_on_severity`.
46
+ - A GitHub Action and a pre-commit hook that run `openqodex scan`.
47
+ - `openqodex demo` builds a small repo with planted bugs and scans it.
48
+
49
+ ## What it does not do yet
50
+
51
+ - No review on your own API key. The review runs on your agent's model only.
52
+ - No tool server for agents (MCP).
53
+ - No Homebrew formula, no install script and no Docker image. Install through npm.
54
+ - No Windows support outside WSL.
55
+ - No offline copy of the vulnerability database. The dependency check asks osv.dev.
56
+
57
+ ## First run
58
+
59
+ Scanners download on first use into `~/.openqodex/tools/`. Only the scanners your change needs download. The table below gives each download size.
60
+
61
+ Installed scanners take more disk than their downloads. The eight scanners the demo needs take about 700 MB of disk on an Apple Silicon Mac. semgrep with its Python takes about 440 MB of that.
62
+
63
+ A scanner install that takes longer than 45 seconds keeps going in the background. The report lists that scanner as installing. The scanner joins the next run. To install every scanner up front, run `npx openqodex doctor --install`.
64
+
65
+ One measured first run: an Apple Silicon Mac, an empty tool folder, a line of 2 MB per second. The first `openqodex demo` printed its report in under a minute. That report held the scanners that had finished installing and listed the rest as installing. The next `scan` included all eight scanners. Your times depend on your line.
66
+
67
+ OpenQodex does not install language runtimes. brakeman and rubocop need Ruby 2.7 or newer. golangci-lint needs Go. Without them, the report lists those scanners as not installed, with the reason.
68
+
69
+ ## Built-in scanners
70
+
71
+ | Scanner | Version | Runs when the change holds | Needs | Download (Apple Silicon, Linux x64) |
72
+ |---|---|---|---|---|
73
+ | semgrep | 1.94.0 | any file | Python 3.11, downloaded through uv | about 86 MB with bandit, measured on Apple Silicon |
74
+ | gitleaks | 8.21.2 | any file | nothing | 2.9 MB, 3.0 MB |
75
+ | bandit | 1.9.4 | `.py`, `.pyi` | the same Python as semgrep | included with semgrep |
76
+ | ruff | 0.8.4 | `.py`, `.pyi` | nothing | 9.9 MB, 11.2 MB |
77
+ | oxlint | 1.71.0 | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs`, `.cjs`, `.mts`, `.cts` | npm, which ships with Node | 7.3 MB, 8.2 MB |
78
+ | osv-scanner | 1.9.2 | a lockfile, such as `package-lock.json` or `go.sum` | network access to osv.dev | 31.8 MB, 32.1 MB |
79
+ | actionlint | 1.7.7 | `.github/workflows/*.yml` | nothing | 2.0 MB, 2.1 MB |
80
+ | hadolint | 2.15.1 | a Dockerfile | nothing | 102.6 MB, 55.7 MB |
81
+ | shellcheck | 0.10.0 | `.sh`, `.bash` | `xz` to unpack | 7.2 MB, 2.4 MB |
82
+ | golangci-lint | 2.12.2 | `.go` | Go | 14.4 MB, 15.0 MB |
83
+ | brakeman | 6.2.1 | a Ruby or Rails file, in a repo with a `Gemfile` and an `app/` folder | Ruby 2.7 or newer; see its licence below | from RubyGems, not measured |
84
+ | rubocop | 1.69.2 | `.rb`, `.rake`, `.gemspec`, `Gemfile`, `Rakefile` | Ruby 2.7 or newer | from RubyGems, not measured |
85
+ | sqllint | built in | `.sql` | nothing, it runs inside OpenQodex | none |
86
+
87
+ [docs/scanners.md](docs/scanners.md) lists every file each scanner reads and what each one sends.
88
+
89
+ brakeman's licence is the Brakeman Public Use License, which is not an open source licence. OpenQodex does not bundle brakeman. It downloads brakeman at run time onto your machine. `scanners.disable: [brakeman]` switches it off.
90
+
91
+ ## Add any scanner
92
+
93
+ Add a scanner by its GitHub link in `.openqodex.yaml` at the root of your repo:
94
+
95
+ ```yaml
96
+ scanners:
97
+ custom:
98
+ - source: https://github.com/aquasecurity/trivy
99
+ run: trivy config --format sarif --output {report} {target}
100
+ ```
101
+
102
+ A custom scanner is a command that runs on your machine. It never runs until you approve it:
103
+
104
+ ```
105
+ npx openqodex trust
106
+ ```
107
+
108
+ `trust` picks the release asset for your machine and downloads it. It shows the version, the asset, its sha256 and the run line, then asks yes or no. An edited entry needs a new approval. [docs/custom-scanners.md](docs/custom-scanners.md) explains each step.
109
+
110
+ ## What goes over the network
111
+
112
+ - Scanner downloads on first use: GitHub release files checked against pinned sha256 sums, and pinned packages from PyPI, npm and RubyGems.
113
+ - Semgrep rule packs (`p/default`, `p/security-audit`, `p/secrets`), fetched from the Semgrep registry on each run.
114
+ - When the change holds a lockfile, osv-scanner sends dependency names and versions to osv.dev. It never sends code.
115
+
116
+ - `openqodex trust` reads the custom scanner's release from the GitHub API and downloads it.
117
+
118
+ `--offline` skips osv-scanner and semgrep and turns scanner downloads off.
119
+
120
+ The built-in scanners send no code anywhere. Your agent's model sees what your agent reads, as always. A custom scanner you approved does whatever its own command does. [docs/security.md](docs/security.md) gives the full list.
121
+
122
+ ## Packages
123
+
124
+ | Package | What it is |
125
+ |---|---|
126
+ | [`openqodex`](https://www.npmjs.com/package/openqodex) | One package. It holds the CLI as one bundled file with no runtime dependencies. The skill, the agent templates, the docs, the review patterns and the demo ship as separate files beside it. |
127
+
128
+ `@openqodex/core` and `@openqodex/scanners` are internal workspace packages. The CLI bundles them, and they are not published.
129
+
130
+ ## Documentation
131
+
132
+ The docs ship inside the package. `npx openqodex guide <topic>` prints a page offline.
133
+
134
+ - [Quickstart](docs/quickstart.md)
135
+ - [Commands](docs/cli.md)
136
+ - [Configuration](docs/config.md)
137
+ - [Scanners](docs/scanners.md)
138
+ - [Custom scanners](docs/custom-scanners.md)
139
+ - [Agents](docs/agents.md)
140
+ - [GitHub Action](docs/github-action.md)
141
+ - [Security](docs/security.md)
142
+ - [FAQ](docs/faq.md)
143
+
144
+ ## Telemetry
145
+
146
+ None. OpenQodex sends no usage data. semgrep runs with its own metrics switched off. See [docs/telemetry.md](docs/telemetry.md).
147
+
148
+ ## Security
149
+
150
+ Report a vulnerability through GitHub's private vulnerability reporting on this repo. Never open a public issue for one. See [SECURITY.md](https://github.com/openqodex/openqodex/blob/main/SECURITY.md).
151
+
152
+ ## Status
153
+
154
+ OpenQodex is new and on the way to 1.0. Commands, flags and the config file can change between minor releases. [CHANGELOG.md](https://github.com/openqodex/openqodex/blob/main/CHANGELOG.md) records every change.
155
+
156
+ ## Made by Qodex
157
+
158
+ OpenQodex is made by [Qodex](https://qodex.ai?utm_source=openqodex&utm_medium=readme), which also runs a hosted review on every pull request.
159
+
160
+ Licensed under [Apache 2.0](LICENSE). See [NOTICE](NOTICE) for the scanners' licences.
@@ -0,0 +1,18 @@
1
+ name: ci
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
15
+ with:
16
+ python-version: "3.12"
17
+ - run: pip install -r requirements.txt
18
+ - run: python -m compileall app
@@ -0,0 +1,12 @@
1
+ FROM python:3.12.7-slim-bookworm
2
+
3
+ RUN useradd --create-home --uid 10001 app
4
+ WORKDIR /home/app
5
+
6
+ COPY requirements.txt .
7
+ RUN pip install --no-cache-dir -r requirements.txt
8
+ COPY app ./app
9
+
10
+ USER 10001
11
+ EXPOSE 5000
12
+ CMD ["python", "-m", "flask", "--app", "app.server", "run", "--host", "0.0.0.0"]
File without changes
@@ -0,0 +1,37 @@
1
+ import sqlite3
2
+
3
+ from flask import Flask, jsonify, request
4
+
5
+ app = Flask(__name__)
6
+
7
+ DATABASE = "items.db"
8
+ PAGE_SIZE = 20
9
+
10
+
11
+ def get_db():
12
+ conn = sqlite3.connect(DATABASE)
13
+ conn.row_factory = sqlite3.Row
14
+ return conn
15
+
16
+
17
+ @app.get("/items")
18
+ def list_items():
19
+ page = max(int(request.args.get("page", "1")), 1)
20
+ offset = (page - 1) * PAGE_SIZE
21
+ with get_db() as conn:
22
+ rows = conn.execute(
23
+ "SELECT id, name, price FROM items ORDER BY id LIMIT ? OFFSET ?",
24
+ (PAGE_SIZE, offset),
25
+ ).fetchall()
26
+ return jsonify([dict(row) for row in rows])
27
+
28
+
29
+ @app.get("/items/<int:item_id>")
30
+ def get_item(item_id):
31
+ with get_db() as conn:
32
+ row = conn.execute(
33
+ "SELECT id, name, price FROM items WHERE id = ?", (item_id,)
34
+ ).fetchone()
35
+ if row is None:
36
+ return jsonify({"error": "not found"}), 404
37
+ return jsonify(dict(row))
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "demo-shop",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "demo-shop",
9
+ "version": "1.0.0",
10
+ "dependencies": {
11
+ "lodash": "4.18.1"
12
+ }
13
+ },
14
+ "node_modules/lodash": {
15
+ "version": "4.18.1",
16
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz",
17
+ "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==",
18
+ "license": "MIT"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "demo-shop",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "description": "Front-end helpers for the demo shop.",
6
+ "dependencies": {
7
+ "lodash": "4.18.1"
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ flask==3.1.3
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # Copies the app to the deploy folder and lists what was deployed.
3
+ set -euo pipefail
4
+
5
+ DEPLOY_DIR="${DEPLOY_DIR:-/srv/demo}"
6
+
7
+ rm -rf "${DEPLOY_DIR:?}/"
8
+ mkdir -p "$DEPLOY_DIR"
9
+ cp -R app requirements.txt "$DEPLOY_DIR/"
10
+
11
+ for file in "$DEPLOY_DIR"/*; do
12
+ echo "deployed: $file"
13
+ done
@@ -0,0 +1,126 @@
1
+ {
2
+ "version": 1,
3
+ "secret": {
4
+ "file": "planted/app/config.py",
5
+ "placeholder": "{{GENERATED_SECRET}}",
6
+ "shape": "sk_live_ followed by 24 random letters and digits, generated when the demo is built"
7
+ },
8
+ "observed_with": {
9
+ "date": "2026-10-02",
10
+ "gitleaks": "8.30.1",
11
+ "hadolint": "2.15.1",
12
+ "shellcheck": "0.11.0",
13
+ "actionlint": "1.7.12",
14
+ "bandit": "1.9.4",
15
+ "osv-scanner": "2.6.0",
16
+ "semgrep": "1.176.0 with p/default, p/security-audit and p/secrets"
17
+ },
18
+ "bugs": [
19
+ {
20
+ "id": "secret",
21
+ "class": "hardcoded secret",
22
+ "file": "app/config.py",
23
+ "lines": [2, 2],
24
+ "detectors": [
25
+ { "scanner": "gitleaks", "rule_id": "stripe-access-token" },
26
+ { "scanner": "semgrep", "rule_id": "generic.secrets.security.detected-stripe-api-key.detected-stripe-api-key" }
27
+ ]
28
+ },
29
+ {
30
+ "id": "sql-injection",
31
+ "class": "SQL injection",
32
+ "file": "app/search.py",
33
+ "lines": [14, 14],
34
+ "detectors": [
35
+ { "scanner": "bandit", "rule_id": "B608" },
36
+ { "scanner": "semgrep", "rule_id": "python.lang.security.audit.formatted-sql-query.formatted-sql-query" },
37
+ { "scanner": "semgrep", "rule_id": "python.flask.security.injection.tainted-sql-string.tainted-sql-string" }
38
+ ]
39
+ },
40
+ {
41
+ "id": "docker-latest-base",
42
+ "class": "unpinned base image",
43
+ "file": "Dockerfile",
44
+ "lines": [1, 1],
45
+ "detectors": [{ "scanner": "hadolint", "rule_id": "DL3007" }]
46
+ },
47
+ {
48
+ "id": "docker-apt-install",
49
+ "class": "unpinned and uncleaned apt install",
50
+ "file": "Dockerfile",
51
+ "lines": [3, 3],
52
+ "detectors": [
53
+ { "scanner": "hadolint", "rule_id": "DL3008" },
54
+ { "scanner": "hadolint", "rule_id": "DL3015" },
55
+ { "scanner": "hadolint", "rule_id": "DL3009" },
56
+ { "scanner": "hadolint", "rule_id": "DL3014" }
57
+ ]
58
+ },
59
+ {
60
+ "id": "docker-add",
61
+ "class": "ADD used for a local file",
62
+ "file": "Dockerfile",
63
+ "lines": [6, 6],
64
+ "detectors": [{ "scanner": "hadolint", "rule_id": "DL3020" }]
65
+ },
66
+ {
67
+ "id": "docker-pip-cache",
68
+ "class": "pip cache kept in the image",
69
+ "file": "Dockerfile",
70
+ "lines": [7, 7],
71
+ "detectors": [{ "scanner": "hadolint", "rule_id": "DL3042" }]
72
+ },
73
+ {
74
+ "id": "docker-root",
75
+ "class": "container runs as root",
76
+ "file": "Dockerfile",
77
+ "lines": [11, 11],
78
+ "detectors": null,
79
+ "note": "The change removes the USER line. semgrep reports the missing user on the last line, which the change does not touch, so the changed-line filter drops it. Only a reviewer reading the diff finds it."
80
+ },
81
+ {
82
+ "id": "vulnerable-lodash",
83
+ "class": "vulnerable dependency (lodash 4.17.15, CVE-2020-8203)",
84
+ "file": "package-lock.json",
85
+ "lines": [11, 11],
86
+ "detectors": [{ "scanner": "osv-scanner", "rule_id": "GHSA-p6mc-m468-83gw" }]
87
+ },
88
+ {
89
+ "id": "shell-rm-unquoted",
90
+ "class": "rm -rf on an unquoted variable",
91
+ "file": "scripts/deploy.sh",
92
+ "lines": [7, 7],
93
+ "detectors": [
94
+ { "scanner": "shellcheck", "rule_id": "SC2115" },
95
+ { "scanner": "shellcheck", "rule_id": "SC2086" }
96
+ ]
97
+ },
98
+ {
99
+ "id": "shell-ls-loop",
100
+ "class": "loop over unquoted ls output",
101
+ "file": "scripts/deploy.sh",
102
+ "lines": [11, 11],
103
+ "detectors": [
104
+ { "scanner": "shellcheck", "rule_id": "SC2045" },
105
+ { "scanner": "shellcheck", "rule_id": "SC2086" }
106
+ ]
107
+ },
108
+ {
109
+ "id": "workflow-injection",
110
+ "class": "script injection in a GitHub workflow",
111
+ "file": ".github/workflows/ci.yml",
112
+ "lines": [15, 15],
113
+ "detectors": [
114
+ { "scanner": "actionlint", "rule_id": "expression" },
115
+ { "scanner": "semgrep", "rule_id": "yaml.github-actions.security.run-shell-injection.run-shell-injection" }
116
+ ]
117
+ },
118
+ {
119
+ "id": "pagination-off-by-one",
120
+ "class": "logic bug: the first page is skipped",
121
+ "file": "app/server.py",
122
+ "lines": [23, 23],
123
+ "detectors": null
124
+ }
125
+ ]
126
+ }
@@ -0,0 +1,20 @@
1
+ name: ci
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14
+ - name: Show the pull request
15
+ run: echo "Testing ${{ github.event.pull_request.title }}"
16
+ - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
17
+ with:
18
+ python-version: "3.12"
19
+ - run: pip install -r requirements.txt
20
+ - run: python -m compileall app