JS: Support for newer version of Hapi - @hapi/hapi#19124
Merged
Napalys merged 3 commits intogithub:mainfrom Mar 27, 2025
Merged
JS: Support for newer version of Hapi - @hapi/hapi#19124Napalys merged 3 commits intogithub:mainfrom
Hapi - @hapi/hapi#19124Napalys merged 3 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the codebase to support the newer version of Hapi using the new import name "@hapi/hapi" and server function, ensuring that CodeQL can correctly detect alerts related to TaintedPath CWE-022.
- Updated test code in the Security query-tests to use "@hapi/hapi".
- Revised library test code for Hapi server instantiation.
- Documented the changes in the library change-notes.
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/hapi.js | Introduces a new test case using the updated Hapi import and server function. |
| javascript/ql/test/library-tests/frameworks/hapi/src/hapihapi.js | Updates server instantiation to support the new Hapi API. |
| javascript/ql/lib/change-notes/2025-03-26-Hapi.md | Adds a brief change note documenting the update. |
Files not reviewed (3)
- javascript/ql/lib/semmle/javascript/frameworks/Hapi.qll: Language not supported
- javascript/ql/test/library-tests/frameworks/hapi/tests.expected: Language not supported
- javascript/ql/test/query-tests/Security/CWE-022/TaintedPath/TaintedPath.expected: Language not supported
Comments suppressed due to low confidence (1)
javascript/ql/test/library-tests/frameworks/hapi/src/hapihapi.js:1
- [nitpick] The file uses two different patterns for instantiating a Hapi server. For consistency and clarity, consider unifying the instantiation style (either using inline require or assigning the module to a variable).
var server1 = new (require('@hapi/hapi')).Server(); // HTTP::Server
Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more
asgerf
approved these changes
Mar 27, 2025
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.
The latest version of
Hapiintroduces a new import name,@hapi/hapi, and a new server function.Without this update,
CodeQLwould miss alerts related to the TaintedPath CWE-022 when using the newer version of theHapiserver.