@victor-software-house/is-node-vulnerable 1.0.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Victor Araújo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # Node.js Security Vulnerability Checker
2
+
3
+ TypeScript-based Node.js security vulnerability checker with Zod validation and bundled security data.
4
+
5
+ Based on [`is-my-node-vulnerable`](https://github.com/nodejs/is-my-node-vulnerable) but fully typed and properly structured.
6
+
7
+ ## Features
8
+
9
+ - **TypeScript**: Full type safety with comprehensive type definitions
10
+ - **Zod Validation**: All external JSON data validated with Zod schemas
11
+ - **Bundled Data**: Security data included with package, no network calls at runtime
12
+ - **Daily Auto-Updates**: Data automatically updated via GitHub Actions
13
+ - **Platform-Specific**: Checks platform-specific vulnerabilities
14
+ - **Modular**: Clean separation of concerns
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install @victor-software-house/is-node-vulnerable
20
+ # or
21
+ pnpm add @victor-software-house/is-node-vulnerable
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ### As CLI
27
+
28
+ ```bash
29
+ # Check current Node.js version
30
+ npx @victor-software-house/is-node-vulnerable
31
+
32
+ # With debug output
33
+ DEBUG=1 npx @victor-software-house/is-node-vulnerable
34
+
35
+ # Skip check (emergency)
36
+ SKIP_NODE_SECURITY_CHECK=1 node index.js
37
+ ```
38
+
39
+ ### As Module
40
+
41
+ ```typescript
42
+ import { isNodeVulnerable, isNodeEOL } from '@victor-software-house/is-node-vulnerable';
43
+
44
+ // Check if a specific version is vulnerable
45
+ const vulnerable = isNodeVulnerable('v20.10.0', 'darwin');
46
+ console.log(vulnerable); // false
47
+
48
+ // Check if a version is end-of-life
49
+ const isEOL = isNodeEOL('v16.0.0');
50
+ console.log(isEOL); // true
51
+ ```
52
+
53
+ ### In Package Scripts
54
+
55
+ ```json
56
+ {
57
+ "scripts": {
58
+ "prebuild": "@victor-software-house/is-node-vulnerable",
59
+ "check:security": "DEBUG=1 @victor-software-house/is-node-vulnerable"
60
+ }
61
+ }
62
+ ```
63
+
64
+ ## API
65
+
66
+ ### `isNodeVulnerable(version: string, platform?: Platform): boolean`
67
+
68
+ Check if a Node.js version is vulnerable to known CVEs.
69
+
70
+ **Parameters:**
71
+
72
+ - `version`: Node.js version (e.g., `"v20.10.0"`, `"18.0.0"`)
73
+ - `platform`: Optional platform (`"darwin"`, `"linux"`, `"win32"`, etc.)
74
+
75
+ **Returns:** `true` if vulnerable or EOL, `false` otherwise
76
+
77
+ ### `isNodeEOL(version: string): boolean`
78
+
79
+ Check if a Node.js version is end-of-life.
80
+
81
+ **Parameters:**
82
+
83
+ - `version`: Node.js version (e.g., `"v16.0.0"`)
84
+
85
+ **Returns:** `true` if EOL, `false` otherwise
86
+
87
+ ## Data Source
88
+
89
+ Security data is bundled with the package and automatically updated daily via GitHub Actions:
90
+
91
+ - **schedule.json**: Node.js release schedule from [nodejs/Release](https://github.com/nodejs/Release)
92
+ - **security.json**: CVE database from [nodejs/security-wg](https://github.com/nodejs/security-wg)
93
+
94
+ Data is synchronized daily at midnight UTC. For the latest security updates, use the most recent package version.
95
+
96
+ ## Exit Codes (CLI)
97
+
98
+ - `0` - Node.js version is secure
99
+ - `1` - Node.js version is vulnerable or EOL
100
+ - `2` - Check failed (unexpected error)
101
+
102
+ ## Environment Variables
103
+
104
+ - `DEBUG=1` - Enable debug logging
105
+ - `SKIP_NODE_SECURITY_CHECK=1` - Skip security check (emergency use only)
106
+
107
+ ## License
108
+
109
+ MIT © Victor Araújo
110
+
111
+ ## Credits
112
+
113
+ Based on [`is-my-node-vulnerable`](https://github.com/nodejs/is-my-node-vulnerable) by Rafael Gonzaga.
@@ -0,0 +1,153 @@
1
+ {
2
+ "v0.8": {
3
+ "start": "2012-06-25",
4
+ "end": "2014-07-31"
5
+ },
6
+ "v0.10": {
7
+ "start": "2013-03-11",
8
+ "end": "2016-10-31"
9
+ },
10
+ "v0.12": {
11
+ "start": "2015-02-06",
12
+ "end": "2016-12-31"
13
+ },
14
+ "v4": {
15
+ "start": "2015-09-08",
16
+ "lts": "2015-10-12",
17
+ "maintenance": "2017-04-01",
18
+ "end": "2018-04-30",
19
+ "codename": "Argon"
20
+ },
21
+ "v5": {
22
+ "start": "2015-10-29",
23
+ "maintenance": "2016-04-30",
24
+ "end": "2016-06-30"
25
+ },
26
+ "v6": {
27
+ "start": "2016-04-26",
28
+ "lts": "2016-10-18",
29
+ "maintenance": "2018-04-30",
30
+ "end": "2019-04-30",
31
+ "codename": "Boron"
32
+ },
33
+ "v7": {
34
+ "start": "2016-10-25",
35
+ "maintenance": "2017-04-30",
36
+ "end": "2017-06-30"
37
+ },
38
+ "v8": {
39
+ "start": "2017-05-30",
40
+ "lts": "2017-10-31",
41
+ "maintenance": "2019-01-01",
42
+ "end": "2019-12-31",
43
+ "codename": "Carbon"
44
+ },
45
+ "v9": {
46
+ "start": "2017-10-01",
47
+ "maintenance": "2018-04-01",
48
+ "end": "2018-06-30"
49
+ },
50
+ "v10": {
51
+ "start": "2018-04-24",
52
+ "lts": "2018-10-30",
53
+ "maintenance": "2020-05-19",
54
+ "end": "2021-04-30",
55
+ "codename": "Dubnium"
56
+ },
57
+ "v11": {
58
+ "start": "2018-10-23",
59
+ "maintenance": "2019-04-22",
60
+ "end": "2019-06-01"
61
+ },
62
+ "v12": {
63
+ "start": "2019-04-23",
64
+ "lts": "2019-10-21",
65
+ "maintenance": "2020-11-30",
66
+ "end": "2022-04-30",
67
+ "codename": "Erbium"
68
+ },
69
+ "v13": {
70
+ "start": "2019-10-22",
71
+ "maintenance": "2020-04-01",
72
+ "end": "2020-06-01"
73
+ },
74
+ "v14": {
75
+ "start": "2020-04-21",
76
+ "lts": "2020-10-27",
77
+ "maintenance": "2021-10-19",
78
+ "end": "2023-04-30",
79
+ "codename": "Fermium"
80
+ },
81
+ "v15": {
82
+ "start": "2020-10-20",
83
+ "maintenance": "2021-04-01",
84
+ "end": "2021-06-01"
85
+ },
86
+ "v16": {
87
+ "start": "2021-04-20",
88
+ "lts": "2021-10-26",
89
+ "maintenance": "2022-10-18",
90
+ "end": "2023-09-11",
91
+ "codename": "Gallium"
92
+ },
93
+ "v17": {
94
+ "start": "2021-10-19",
95
+ "maintenance": "2022-04-01",
96
+ "end": "2022-06-01"
97
+ },
98
+ "v18": {
99
+ "start": "2022-04-19",
100
+ "lts": "2022-10-25",
101
+ "maintenance": "2023-10-18",
102
+ "end": "2025-04-30",
103
+ "codename": "Hydrogen"
104
+ },
105
+ "v19": {
106
+ "start": "2022-10-18",
107
+ "maintenance": "2023-04-01",
108
+ "end": "2023-06-01"
109
+ },
110
+ "v20": {
111
+ "start": "2023-04-18",
112
+ "lts": "2023-10-24",
113
+ "maintenance": "2024-10-22",
114
+ "end": "2026-04-30",
115
+ "codename": "Iron"
116
+ },
117
+ "v21": {
118
+ "start": "2023-10-17",
119
+ "maintenance": "2024-04-01",
120
+ "end": "2024-06-01"
121
+ },
122
+ "v22": {
123
+ "start": "2024-04-24",
124
+ "lts": "2024-10-29",
125
+ "maintenance": "2025-10-21",
126
+ "end": "2027-04-30",
127
+ "codename": "Jod"
128
+ },
129
+ "v23": {
130
+ "start": "2024-10-16",
131
+ "maintenance": "2025-04-01",
132
+ "end": "2025-06-01"
133
+ },
134
+ "v24": {
135
+ "start": "2025-05-06",
136
+ "lts": "2025-10-28",
137
+ "maintenance": "2026-10-20",
138
+ "end": "2028-04-30",
139
+ "codename": "Krypton"
140
+ },
141
+ "v25": {
142
+ "start": "2025-10-15",
143
+ "maintenance": "2026-04-01",
144
+ "end": "2026-06-01"
145
+ },
146
+ "v26": {
147
+ "start": "2026-04-22",
148
+ "lts": "2026-10-28",
149
+ "maintenance": "2027-10-20",
150
+ "end": "2029-04-30",
151
+ "codename": ""
152
+ }
153
+ }