Repository navigation
Address pre-publication review findings - #137
Merged
Merged
Conversation
jdaigneau5
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the actionable findings from the August 20 pre-publication review. Each remediation below explains the defect or drift that prompted the work, the resulting behavior, and the primary files that implement and verify the change.
Changes
1. Fail Closed for Invalid
/webSearchResponses and Restore Its Supported Contract (M3)Why this was needed: The controller previously returned HTTP 200 with zero results when
BasicSearchManagerreported success but omitted the expected hit structure. The endpoint was also still marked as deprecated in public documentation even though it remains supported for the near term.What changed:
BasicSearchManagerresponses for status metadata, notes and errors arrays, a nonnegative integer total, and a hit array./webSearchdeprecation wording while preserving the operator-controlled feature flag and HTTP 410 behavior when disabled.cve-corebehavior that changessizetofrom + 1whensize < from. The application cannot correct this afterBasicSearchManagerconstructs and executes the request.Primary files:
controllers/searchController.js,controllers/searchController.test.js,routes/index.js,routes/index.test.js,utils/errors.js,utils/errors.test.js,routes/swagger.js,api-docs/openapi.json,api-docs/openapi.test.js,README.md2. Match Complete CVSS Vector Tokens (M1)
Why this was needed: Substring matching allowed a requested base metric such as
AV:Nto match an unrelated modified metric such asMAV:N, producing false-positive CVSS vector results.What changed:
Primary files:
utils/cvss.js,utils/cvss.test.js,utils/searchQueryBuilder.js,utils/searchQueryBuilder.test.js,controllers/searchController.test.js3. Make
/searchOrdering and Pagination Metadata Deterministic (M2)Why this was needed: OpenSearch
from/sizepagination without an explicit immutable sort could return duplicates or omit records as shard ordering changed. The response also reported the requested page size instead of the number of records actually returned, including on out-of-range pages.What changed:
cveMetadata.cveId.keywordin ascending order.pageSizefrom the returned hit array.Primary files:
utils/searchQueryBuilder.js,utils/searchQueryBuilder.test.js,controllers/searchController.js,controllers/searchController.test.js,routes/search.integration.test.js,README.md4. Validate Search Mappings During Readiness Checks (M6)
Why this was needed: A minimal
match_allreadiness query could succeed even when the index lacked keyword, text, numeric, boolean, or date mappings required by supported/searchfilters. Such a task could receive traffic and then fail real searches.What changed:
field_capsbefore the existing minimal readiness search.Primary files:
utils/searchReadiness.js,utils/searchReadiness.test.js,utils/searchProvider.js,utils/searchProvider.test.js,routes/index.js,README.md5. Complete the OpenAPI Response Contract (L1)
Why this was needed: OpenAPI described request fields but did not define reusable success or error response bodies, omitted HTTP 502 outcomes, and represented several boolean inputs more narrowly than the runtime validator.
What changed:
/searchresponses, and/webSearchresponses.keywordExactMatch,noRejected, andisVulnerable.Primary files:
routes/swagger.js,routes/index.js,api-docs/openapi.json,api-docs/openapi.test.js6. Remove Confirmed Stale and Unused Code (L2)
Why this was needed: Dead dependencies, configuration, middleware, branches, coverage exclusions, and mocks increased the apparent attack surface and made automated and human review more difficult without providing runtime behavior.
What changed:
debugandhttp-errorsdependencies and their unneeded lockfile entries.public/directory.query_stringconstruction branch.minServerconfiguration and update its stale runtime assertion.Primary files:
package.json,package-lock.json,server.js,utils/searchQueryBuilder.js,config/default.jsonc,config/devel.jsonc,config/prod.jsonc,config/runtime-config.test.js,jest.config.js,routes/search.integration.test.js7. Synchronize Public and Generated Documentation
Why this was needed: Runtime behavior, feature status, response shapes, and readiness semantics must remain consistent across source annotations, generated API specifications, manual-test artifacts, and operator guidance.
What changed:
/webSearchsupport, invalid upstream responses, CVSS token boundaries, deterministic sorting, and actualpageSizesemantics./webSearchis described as a separate supported contract rather than a deprecated endpoint.Primary files:
README.md,routes/index.js,routes/swagger.js,api-docs/openapi.json,api-docs/openapi.test.js,test/postman/README.md,test/postman/buildCollection.js,test/postman/CVE-Search-API.postman_collection.jsonTracked Items Requiring Separate Decisions
/webSearchquery complexity: Query policy, complexity controls, and request-lifecycle cancellation remain under team discussion because the endpoint must remain supported in the near term.search_afterdesign.BasicSearchManagerstill expandssizewhensize < frombefore executing OpenSearch. Resolving that requires acve-corechange or replacing that dependency path.cve-coreintegration stability: Immutable dependency pinning, Node engine alignment, and replacement of private adapter contracts require coordination with the dependency owner.