predisclose 0.1.0__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.
Files changed (41) hide show
  1. predisclose-0.1.0/.github/workflows/ci.yml +27 -0
  2. predisclose-0.1.0/.github/workflows/release.yml +39 -0
  3. predisclose-0.1.0/.gitignore +10 -0
  4. predisclose-0.1.0/CHANGELOG.md +13 -0
  5. predisclose-0.1.0/CONTRIBUTING.md +33 -0
  6. predisclose-0.1.0/LICENSE +202 -0
  7. predisclose-0.1.0/PKG-INFO +163 -0
  8. predisclose-0.1.0/README.ko.md +32 -0
  9. predisclose-0.1.0/README.md +131 -0
  10. predisclose-0.1.0/SECURITY.md +19 -0
  11. predisclose-0.1.0/docs/how-it-works.md +77 -0
  12. predisclose-0.1.0/docs/limitations.md +22 -0
  13. predisclose-0.1.0/docs/privacy.md +36 -0
  14. predisclose-0.1.0/pyproject.toml +57 -0
  15. predisclose-0.1.0/scripts/eval_recall.py +134 -0
  16. predisclose-0.1.0/skills/predisclose/SKILL.md +36 -0
  17. predisclose-0.1.0/src/predisclose/__init__.py +3 -0
  18. predisclose-0.1.0/src/predisclose/__main__.py +3 -0
  19. predisclose-0.1.0/src/predisclose/checks/__init__.py +1 -0
  20. predisclose-0.1.0/src/predisclose/checks/activity.py +66 -0
  21. predisclose-0.1.0/src/predisclose/checks/fixes.py +215 -0
  22. predisclose-0.1.0/src/predisclose/checks/known.py +79 -0
  23. predisclose-0.1.0/src/predisclose/checks/route.py +238 -0
  24. predisclose-0.1.0/src/predisclose/checks/similarity.py +63 -0
  25. predisclose-0.1.0/src/predisclose/cli.py +267 -0
  26. predisclose-0.1.0/src/predisclose/core.py +78 -0
  27. predisclose-0.1.0/src/predisclose/ecosystems.py +101 -0
  28. predisclose-0.1.0/src/predisclose/http.py +171 -0
  29. predisclose-0.1.0/src/predisclose/ledger.py +170 -0
  30. predisclose-0.1.0/src/predisclose/models.py +82 -0
  31. predisclose-0.1.0/src/predisclose/output.py +92 -0
  32. predisclose-0.1.0/src/predisclose/sources/__init__.py +1 -0
  33. predisclose-0.1.0/src/predisclose/sources/advisory.py +69 -0
  34. predisclose-0.1.0/src/predisclose/sources/ghsa.py +76 -0
  35. predisclose-0.1.0/src/predisclose/sources/github.py +79 -0
  36. predisclose-0.1.0/src/predisclose/sources/osv.py +69 -0
  37. predisclose-0.1.0/src/predisclose/sources/registry.py +53 -0
  38. predisclose-0.1.0/tests/test_core_offline.py +112 -0
  39. predisclose-0.1.0/tests/test_ledger.py +56 -0
  40. predisclose-0.1.0/tests/test_parsing.py +91 -0
  41. predisclose-0.1.0/tests/test_route_policy.py +96 -0
@@ -0,0 +1,27 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ python: ["3.11", "3.12", "3.13"]
18
+ steps:
19
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20
+ with:
21
+ persist-credentials: false
22
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
23
+ with:
24
+ python-version: ${{ matrix.python }}
25
+ - run: python -m pip install -e ".[dev]"
26
+ - run: ruff check .
27
+ - run: pytest -q
@@ -0,0 +1,39 @@
1
+ name: release
2
+
3
+ # Publishes to PyPI with Trusted Publishing (no stored token) when a GitHub release is published.
4
+ on:
5
+ release:
6
+ types: [published]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
+ with:
17
+ persist-credentials: false
18
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
19
+ with:
20
+ python-version: "3.13"
21
+ - run: python -m pip install build
22
+ - run: python -m build
23
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
24
+ with:
25
+ name: dist
26
+ path: dist/
27
+
28
+ publish:
29
+ needs: build
30
+ runs-on: ubuntu-latest
31
+ environment: pypi
32
+ permissions:
33
+ id-token: write
34
+ steps:
35
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
@@ -0,0 +1,10 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ *.sqlite
10
+ report.md
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (2026-11-19)
4
+
5
+ First release.
6
+
7
+ - `check`: public record (OSV + GitHub Advisory Database), public fix (commits and releases since
8
+ the tested version, fix commits named by advisories), recent activity, and where to report.
9
+ - `route`: reporting channel only. Reads `SECURITY.md` (repository, then the owner's `.github`
10
+ repository), GitHub private vulnerability reporting status, and `security.txt`.
11
+ - `ledger`: local record of sent reports with deadlines and a redacted export for portfolios.
12
+ - `--json`, `--markdown`, `--show-queries`, `--dry-run`, `--only`, finding files in TOML.
13
+ - Skill file for coding agents in `skills/predisclose/SKILL.md`.
@@ -0,0 +1,33 @@
1
+ # Contributing
2
+
3
+ Thanks for helping. Small, focused pull requests are easiest to review.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ uv venv && uv pip install -e ".[dev]" # or: python -m venv .venv && pip install -e ".[dev]"
9
+ ruff check . && pytest -q
10
+ ```
11
+
12
+ Tests never touch the network. Use `httpx.MockTransport` like `tests/test_core_offline.py`.
13
+
14
+ ## Good first contributions
15
+
16
+ - **A SECURITY.md layout we get wrong.** Add a short example of the layout to
17
+ `tests/test_route_policy.py` (write it in your own words; do not paste the project's text),
18
+ then fix `parse_policy` in `src/predisclose/checks/route.py`.
19
+ - **A registry we cannot map to a repository.** Extend `src/predisclose/sources/registry.py`.
20
+ - **A tag naming pattern we miss.** Extend `resolve_version` in `src/predisclose/sources/github.py`.
21
+
22
+ ## Rules the code keeps
23
+
24
+ - Public data only. No feature may reproduce, scan, or test a target, or post anything.
25
+ - Nothing the user writes about their finding (keywords, functions, notes) may be sent anywhere.
26
+ CWE ids are matched locally too.
27
+ - Never word a result as "new" or "unreported".
28
+ - Every result explains why, with a link.
29
+
30
+ ## AI-assisted contributions
31
+
32
+ They are welcome. Please say so in the pull request, and make sure you have read and tested every
33
+ line yourself.
@@ -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.
@@ -0,0 +1,163 @@
1
+ Metadata-Version: 2.5
2
+ Name: predisclose
3
+ Version: 0.1.0
4
+ Summary: Before you disclose a vulnerability: check public records, public fixes, and the project's official reporting channel.
5
+ Project-URL: Homepage, https://github.com/rlawltnrj/predisclose
6
+ Project-URL: Repository, https://github.com/rlawltnrj/predisclose
7
+ Project-URL: Issues, https://github.com/rlawltnrj/predisclose/issues
8
+ Project-URL: Changelog, https://github.com/rlawltnrj/predisclose/blob/main/CHANGELOG.md
9
+ Author: predisclose contributors
10
+ License-Expression: Apache-2.0
11
+ License-File: LICENSE
12
+ Keywords: advisory,cve,disclosure,ghsa,osv,security,vulnerability
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Security
24
+ Requires-Python: >=3.11
25
+ Requires-Dist: httpx>=0.27
26
+ Requires-Dist: rich>=13
27
+ Requires-Dist: typer>=0.12
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8; extra == 'dev'
30
+ Requires-Dist: ruff>=0.6; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # predisclose
34
+
35
+ **Before you disclose a vulnerability, spend one minute checking what is already public.**
36
+
37
+ `predisclose` looks at public data only and answers four questions about an open-source project:
38
+
39
+ 1. **Public record**: is there already a public advisory that looks like your finding? (OSV, GitHub Advisory Database)
40
+ 2. **Public fix**: has the affected code changed since the version you tested?
41
+ 3. **Recent activity**: has this area had advisories recently? Busy areas get more parallel reports.
42
+ 4. **Where to report**: what channel does the project ask for? (SECURITY.md, GitHub private vulnerability reporting, security.txt)
43
+
44
+ It also keeps a **local ledger** of the reports you have sent, with deadlines and an export for your portfolio that hides anything not yet public.
45
+
46
+ ```text
47
+ $ predisclose check --pkg pypi:jinja2 --version 2.10 --cwe CWE-693 --file sandbox.py
48
+
49
+ Check Result Summary
50
+ Public record CHECK 6 public advisories affect PyPI jinja2 2.10; 0 strong and 2 medium matches
51
+ Public fix CHECK 33 commits changed sandbox.py since 2.10 (2017-11-08); 2 look security-related
52
+ (1 linked to public advisories)
53
+ Recent activity none No advisories published in the last 365 days.
54
+ Where to report FOUND Follow SECURITY.md: GitHub private vulnerability reporting ->
55
+ https://github.com/pallets/jinja/security/advisories/new
56
+
57
+ Public record
58
+ medium GHSA-q2x7-8rv6-6q7h 2024-12-23 Jinja has a sandbox breakout through indirect reference
59
+ to format method (same CWE: CWE-693)
60
+ ...
61
+ ```
62
+
63
+ Note what happened there: the file moved from `jinja2/` to `src/jinja2/` after 2.10 and is still
64
+ followed, and the reporting channel came from the organization-wide policy in `pallets/.github`.
65
+
66
+ ## What it does not do
67
+
68
+ - It does **not** say a finding is new. Reports sent privately by other people are invisible to everyone except the maintainers. "No public record" is the strongest thing any tool can honestly say.
69
+ - It does **not** reproduce, scan, or test anything. It only reads public metadata.
70
+ - It does **not** send reports for you or post anything anywhere.
71
+ - It does **not** send your description of the issue anywhere. Only the package name, version, file paths, and CWE ids leave your machine, as listed by `--show-queries`.
72
+
73
+ ## Install
74
+
75
+ ```bash
76
+ pipx install predisclose # or: uv tool install predisclose
77
+ # before the first PyPI release:
78
+ pipx install git+https://github.com/rlawltnrj/predisclose
79
+ ```
80
+
81
+ Python 3.11 or newer. A GitHub token is optional but recommended: unauthenticated GitHub API calls are limited to 60 per hour.
82
+
83
+ ```bash
84
+ export GITHUB_TOKEN=$(gh auth token) # any token works; no scopes are needed for public data
85
+ ```
86
+
87
+ ## Use
88
+
89
+ ```bash
90
+ # Package on a registry (PyPI, npm, crates.io, Go, Maven, NuGet, RubyGems, Packagist, Pub, Hex)
91
+ predisclose check --pkg npm:express --version 4.17.1 --cwe CWE-601
92
+
93
+ # A GitHub repository that is not on a registry (version = tag or commit)
94
+ predisclose check --repo owner/name --version v1.2.0 --file src/parser.c --function parse_header
95
+
96
+ # Only the reporting channel
97
+ predisclose route owner/name
98
+
99
+ # From a file (handy for agents and scripts)
100
+ predisclose check --from finding.toml --json
101
+ ```
102
+
103
+ `finding.toml`:
104
+
105
+ ```toml
106
+ package = "pypi:jinja2"
107
+ version = "2.10"
108
+ cwe = ["CWE-693"]
109
+ files = ["src/jinja2/sandbox.py"]
110
+ functions = ["SandboxedEnvironment"]
111
+ notes = "free text for yourself; never sent anywhere"
112
+ ```
113
+
114
+ Useful flags: `--show-queries` (print every request that was sent), `--dry-run` (print the first requests and send nothing), `--markdown report.md`, `--only known,route`, `--no-cache`.
115
+
116
+ ### Ledger
117
+
118
+ ```bash
119
+ predisclose ledger add owner/name "Path traversal in upload handler" --channel github-pvr
120
+ predisclose ledger update 1 --status published --ids CVE-2026-12345 --url https://github.com/advisories/GHSA-xxxx
121
+ predisclose ledger due # deadlines in the next 14 days
122
+ predisclose ledger export -o reports.md
123
+ ```
124
+
125
+ The ledger lives in `~/.local/share/predisclose/ledger.sqlite` and never leaves your machine. `export` keeps full details only for reports marked public. Everything else becomes "Undisclosed report" with the month it was sent.
126
+
127
+ ## How matching works
128
+
129
+ Every advisory that affects the target is scored against your hints. The rules are deterministic, so the same input always gives the same answer:
130
+
131
+ | Level | When |
132
+ |---|---|
133
+ | strong | same CWE **and** same file or function, or same file **and** same function |
134
+ | medium | same CWE, or same file, or same function, or a keyword match |
135
+ | weak | affects this version, no other overlap |
136
+
137
+ Each match lists its reasons and a link, so you can judge it yourself. More in [docs/how-it-works.md](docs/how-it-works.md).
138
+
139
+ ## Validation
140
+
141
+ `scripts/eval_recall.py` samples reviewed GitHub advisories in seven ecosystems (PyPI, npm,
142
+ crates.io, Go, Maven, RubyGems, Packagist). For each one it checks a version inside the vulnerable
143
+ range with the advisory's CWE, and the first patched version as a control.
144
+
145
+ | Run | Recall (advisory found at medium or above) | Control (not listed for the patched version) |
146
+ |---|---|---|
147
+ | 2026-11-19, 32 advisories | 32 / 32 | 32 / 32 |
148
+
149
+ The reporting-channel parser was checked by hand against the policies of curl, express, hyper,
150
+ Jinja, Django, Node.js, OpenSSL, Go, Rails and Next.js (all ten match), and its test suite holds
151
+ our own examples of each layout it has to handle.
152
+
153
+ ## For AI agents
154
+
155
+ `skills/predisclose/SKILL.md` is a ready-made skill for Claude Code, Codex, and similar agents. It tells them to call `predisclose check --json`, never to describe a finding as new, and never to send finding details to other services.
156
+
157
+ ## Privacy and limitations
158
+
159
+ See [docs/privacy.md](docs/privacy.md) and [docs/limitations.md](docs/limitations.md).
160
+
161
+ ## License
162
+
163
+ Apache-2.0
@@ -0,0 +1,32 @@
1
+ # predisclose (한국어 안내)
2
+
3
+ **취약점을 제보하기 전에, 이미 공개된 것이 있는지 1분만 확인하세요.**
4
+
5
+ `predisclose`는 공개 데이터만 사용해 오픈소스 프로젝트에 대해 네 가지를 알려 줍니다.
6
+
7
+ 1. **공개 기록**: 내 발견과 비슷한 공개 권고가 이미 있나요? (OSV, GitHub Advisory Database)
8
+ 2. **공개 수정**: 내가 시험한 버전 이후 해당 코드가 바뀌었나요?
9
+ 3. **최근 활동**: 이 영역에 최근 권고가 많았나요? 그런 곳엔 비슷한 제보가 몰립니다.
10
+ 4. **제보 창구**: 프로젝트가 원하는 제보 경로는 어디인가요? (SECURITY.md, GitHub 비공개 제보, security.txt)
11
+
12
+ 보낸 제보를 기록하는 **로컬 원장**도 있습니다. 마감일을 알려 주고, 포트폴리오용으로 내보낼 때 공개되지 않은 건은 자동으로 가립니다.
13
+
14
+ ## 하지 않는 일
15
+
16
+ - "새로운 취약점"이라고 판정하지 않습니다. 다른 사람이 비공개로 먼저 낸 제보는 누구도 볼 수 없기 때문입니다.
17
+ - 재현, 스캔, 시험을 하지 않습니다. 공개 정보만 읽습니다.
18
+ - 제보를 대신 보내거나 어디에 글을 올리지 않습니다.
19
+ - 발견 내용 설명은 내 컴퓨터 밖으로 나가지 않습니다. 밖으로 나가는 요청은 `--show-queries`로 모두 볼 수 있습니다.
20
+
21
+ ## 설치와 사용
22
+
23
+ ```bash
24
+ pipx install predisclose
25
+ export GITHUB_TOKEN=$(gh auth token) # 선택 사항이지만 권장 (토큰이 없으면 시간당 60회 제한)
26
+
27
+ predisclose check --pkg pypi:jinja2 --version 2.10 --cwe CWE-693 --file sandbox.py
28
+ predisclose route owner/name
29
+ predisclose ledger add owner/name "제목" --channel github-pvr
30
+ ```
31
+
32
+ 자세한 내용은 [README.md](README.md)(영문), [동작 방식](docs/how-it-works.md), [개인정보](docs/privacy.md), [한계](docs/limitations.md)를 보세요.
@@ -0,0 +1,131 @@
1
+ # predisclose
2
+
3
+ **Before you disclose a vulnerability, spend one minute checking what is already public.**
4
+
5
+ `predisclose` looks at public data only and answers four questions about an open-source project:
6
+
7
+ 1. **Public record**: is there already a public advisory that looks like your finding? (OSV, GitHub Advisory Database)
8
+ 2. **Public fix**: has the affected code changed since the version you tested?
9
+ 3. **Recent activity**: has this area had advisories recently? Busy areas get more parallel reports.
10
+ 4. **Where to report**: what channel does the project ask for? (SECURITY.md, GitHub private vulnerability reporting, security.txt)
11
+
12
+ It also keeps a **local ledger** of the reports you have sent, with deadlines and an export for your portfolio that hides anything not yet public.
13
+
14
+ ```text
15
+ $ predisclose check --pkg pypi:jinja2 --version 2.10 --cwe CWE-693 --file sandbox.py
16
+
17
+ Check Result Summary
18
+ Public record CHECK 6 public advisories affect PyPI jinja2 2.10; 0 strong and 2 medium matches
19
+ Public fix CHECK 33 commits changed sandbox.py since 2.10 (2017-11-08); 2 look security-related
20
+ (1 linked to public advisories)
21
+ Recent activity none No advisories published in the last 365 days.
22
+ Where to report FOUND Follow SECURITY.md: GitHub private vulnerability reporting ->
23
+ https://github.com/pallets/jinja/security/advisories/new
24
+
25
+ Public record
26
+ medium GHSA-q2x7-8rv6-6q7h 2024-12-23 Jinja has a sandbox breakout through indirect reference
27
+ to format method (same CWE: CWE-693)
28
+ ...
29
+ ```
30
+
31
+ Note what happened there: the file moved from `jinja2/` to `src/jinja2/` after 2.10 and is still
32
+ followed, and the reporting channel came from the organization-wide policy in `pallets/.github`.
33
+
34
+ ## What it does not do
35
+
36
+ - It does **not** say a finding is new. Reports sent privately by other people are invisible to everyone except the maintainers. "No public record" is the strongest thing any tool can honestly say.
37
+ - It does **not** reproduce, scan, or test anything. It only reads public metadata.
38
+ - It does **not** send reports for you or post anything anywhere.
39
+ - It does **not** send your description of the issue anywhere. Only the package name, version, file paths, and CWE ids leave your machine, as listed by `--show-queries`.
40
+
41
+ ## Install
42
+
43
+ ```bash
44
+ pipx install predisclose # or: uv tool install predisclose
45
+ # before the first PyPI release:
46
+ pipx install git+https://github.com/rlawltnrj/predisclose
47
+ ```
48
+
49
+ Python 3.11 or newer. A GitHub token is optional but recommended: unauthenticated GitHub API calls are limited to 60 per hour.
50
+
51
+ ```bash
52
+ export GITHUB_TOKEN=$(gh auth token) # any token works; no scopes are needed for public data
53
+ ```
54
+
55
+ ## Use
56
+
57
+ ```bash
58
+ # Package on a registry (PyPI, npm, crates.io, Go, Maven, NuGet, RubyGems, Packagist, Pub, Hex)
59
+ predisclose check --pkg npm:express --version 4.17.1 --cwe CWE-601
60
+
61
+ # A GitHub repository that is not on a registry (version = tag or commit)
62
+ predisclose check --repo owner/name --version v1.2.0 --file src/parser.c --function parse_header
63
+
64
+ # Only the reporting channel
65
+ predisclose route owner/name
66
+
67
+ # From a file (handy for agents and scripts)
68
+ predisclose check --from finding.toml --json
69
+ ```
70
+
71
+ `finding.toml`:
72
+
73
+ ```toml
74
+ package = "pypi:jinja2"
75
+ version = "2.10"
76
+ cwe = ["CWE-693"]
77
+ files = ["src/jinja2/sandbox.py"]
78
+ functions = ["SandboxedEnvironment"]
79
+ notes = "free text for yourself; never sent anywhere"
80
+ ```
81
+
82
+ Useful flags: `--show-queries` (print every request that was sent), `--dry-run` (print the first requests and send nothing), `--markdown report.md`, `--only known,route`, `--no-cache`.
83
+
84
+ ### Ledger
85
+
86
+ ```bash
87
+ predisclose ledger add owner/name "Path traversal in upload handler" --channel github-pvr
88
+ predisclose ledger update 1 --status published --ids CVE-2026-12345 --url https://github.com/advisories/GHSA-xxxx
89
+ predisclose ledger due # deadlines in the next 14 days
90
+ predisclose ledger export -o reports.md
91
+ ```
92
+
93
+ The ledger lives in `~/.local/share/predisclose/ledger.sqlite` and never leaves your machine. `export` keeps full details only for reports marked public. Everything else becomes "Undisclosed report" with the month it was sent.
94
+
95
+ ## How matching works
96
+
97
+ Every advisory that affects the target is scored against your hints. The rules are deterministic, so the same input always gives the same answer:
98
+
99
+ | Level | When |
100
+ |---|---|
101
+ | strong | same CWE **and** same file or function, or same file **and** same function |
102
+ | medium | same CWE, or same file, or same function, or a keyword match |
103
+ | weak | affects this version, no other overlap |
104
+
105
+ Each match lists its reasons and a link, so you can judge it yourself. More in [docs/how-it-works.md](docs/how-it-works.md).
106
+
107
+ ## Validation
108
+
109
+ `scripts/eval_recall.py` samples reviewed GitHub advisories in seven ecosystems (PyPI, npm,
110
+ crates.io, Go, Maven, RubyGems, Packagist). For each one it checks a version inside the vulnerable
111
+ range with the advisory's CWE, and the first patched version as a control.
112
+
113
+ | Run | Recall (advisory found at medium or above) | Control (not listed for the patched version) |
114
+ |---|---|---|
115
+ | 2026-11-19, 32 advisories | 32 / 32 | 32 / 32 |
116
+
117
+ The reporting-channel parser was checked by hand against the policies of curl, express, hyper,
118
+ Jinja, Django, Node.js, OpenSSL, Go, Rails and Next.js (all ten match), and its test suite holds
119
+ our own examples of each layout it has to handle.
120
+
121
+ ## For AI agents
122
+
123
+ `skills/predisclose/SKILL.md` is a ready-made skill for Claude Code, Codex, and similar agents. It tells them to call `predisclose check --json`, never to describe a finding as new, and never to send finding details to other services.
124
+
125
+ ## Privacy and limitations
126
+
127
+ See [docs/privacy.md](docs/privacy.md) and [docs/limitations.md](docs/limitations.md).
128
+
129
+ ## License
130
+
131
+ Apache-2.0