Skip to content

Commit 2dbffc3

Browse files
Merge pull request #65 from CERTCC/bug/Issue_64
Issue Active/Inactive user management fix #64
2 parents 00dea22 + 61218b3 commit 2dbffc3

2 files changed

Lines changed: 35 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# cveClient Changelog
22

3+
## Version 1.0.25 — 2026-03-28
4+
- Bug: Bug fix in `cveClientlib.js` where query params such {active: false} will not work due to weak coercion
5+
- Updated `cveClientlib.js` to version 1.0.26, should support npm usage as well.
6+
37
## Version 1.0.24 — 2026-03-28
48

5-
- Security: Fixed XSS vulnerability — use `.text()` instead of `.html()` for CVE ID in modal title
6-
- Security: Prevent plaintext API key storage and harden encryption key handling
7-
- Security: Added prototype pollution protection to `queryParser` and removed sensitive logging
9+
- Security: Fixed XSS vulnerability — use `.text()` instead of `.html()` for CVE ID in modal title CVE-2026-35466
10+
- Security: Prevent plaintext API key storage and harden encryption key handling CVE-2026-35467
11+
- Security: Added prototype pollution protection to `queryParser` and removed sensitive logging CVE-2026-35466
812
- Updated SweetAlert2 from 11.4.9 to 11.26.24
913
- Made schema references version-agnostic with automatic schema version detection
1014
- Added ADP (Authorized Data Publisher) read and delete support

cveClientlib.js

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,30 @@ class cveClient {
55
this.key = key;
66
this.url = url;
77
this.user_path = "/org/" + this.org + "/user/" + this.user;
8-
this._version = "1.0.25";
8+
this._version = "1.0.26";
9+
}
10+
/* Safely build query string */
11+
_buildQuery(qvars) {
12+
if (!qvars) return "";
13+
14+
const params = new URLSearchParams();
15+
16+
Object.entries(qvars).forEach(([key, val]) => {
17+
/* Skip only null/undefined */
18+
if (val == null) return;
19+
/* Handle arrays (common in APIs) */
20+
if (Array.isArray(val)) {
21+
val.forEach(v => {
22+
if (v != null) params.append(key, String(v));
23+
});
24+
return;
25+
}
26+
27+
/* Normalize everything else */
28+
params.append(key, String(val));
29+
});
30+
31+
return params.toString();
932
}
1033
/* PUT /cve/{id}/adp — the only ADP endpoint per CVE Services API spec
1134
See https://cveawg.mitre.org/api-docs/ */
@@ -139,21 +162,13 @@ class cveClient {
139162
if(!opts) {
140163
opts = {method:'GET'};
141164
}
142-
if(qvars) {
143-
var qstr = new URLSearchParams();
144-
Object.keys(qvars).forEach(function(x) {
145-
/* Remove empty values in query_string
146-
strange issue #11 when changing user's information
147-
see https://github.com/CERTCC/cveClient/issues/11
148-
*/
149-
if(qvars[x] != "")
150-
qstr.append(x,qvars[x]);
151-
});
152-
url.search = qstr.toString();
165+
const qs = this._buildQuery(qvars);
166+
if (qs) {
167+
url.search = qs;
153168
}
154169
if(!('headers' in opts))
155170
opts.headers = {};
156-
opts.headers = Object.assign({},opts.headers,
171+
opts.headers = Object.assign({}, opts.headers || {},
157172
{'CVE-API-KEY': this.key,
158173
'CVE-API-ORG': this.org,
159174
'CVE-API-USER': this.user });

0 commit comments

Comments
 (0)