@js-recon/js-recon 1.4.4 → 2.0.1-alpha.2
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/.claude-sync/sync.sh +1 -1
- package/.github/dependabot.yml +50 -0
- package/.github/workflows/build-and-prettify.yaml +49 -19
- package/.github/workflows/codeql.yml +33 -0
- package/.github/workflows/exploit-smoke-test.yaml +160 -0
- package/.github/workflows/framework-detection-smoke-test.yaml +135 -0
- package/.github/workflows/plumber.yml +20 -0
- package/.github/workflows/promote-js-recon.yml +5 -3
- package/.github/workflows/publish-js-recon.yml +31 -2
- package/.github/workflows/rules-smoke-test.yaml +13 -5
- package/.nvmrc +1 -0
- package/.plumber.yaml +151 -0
- package/CHANGELOG.md +55 -0
- package/CONTRIBUTING.md +32 -0
- package/Dockerfile +1 -0
- package/README.md +3 -2
- package/SECURITY.md +1 -1
- package/build/analyze/engine/astEngine.js +10 -9
- package/build/analyze/engine/astEngine.js.map +1 -1
- package/build/analyze/engine/csMastSEngine.js +6 -6
- package/build/analyze/engine/csMastSEngine.js.map +1 -1
- package/build/analyze/engine/index.js +1 -1
- package/build/analyze/engine/index.js.map +1 -1
- package/build/analyze/engine/requestEngine.js +6 -6
- package/build/analyze/engine/requestEngine.js.map +1 -1
- package/build/analyze/helpers/determineCompatibleVersion.js +70 -0
- package/build/analyze/helpers/determineCompatibleVersion.js.map +1 -0
- package/build/analyze/helpers/engineHelpers/findMemberExpressionAssignment.js +9 -3
- package/build/analyze/helpers/engineHelpers/findMemberExpressionAssignment.js.map +1 -1
- package/build/analyze/helpers/initRules.js +9 -9
- package/build/analyze/helpers/initRules.js.map +1 -1
- package/build/analyze/helpers/outputHelper.js +3 -3
- package/build/analyze/helpers/outputHelper.js.map +1 -1
- package/build/analyze/helpers/schemas.js +1 -0
- package/build/analyze/helpers/schemas.js.map +1 -1
- package/build/analyze/helpers/validate.js +9 -5
- package/build/analyze/helpers/validate.js.map +1 -1
- package/build/analyze/index.js +26 -16
- package/build/analyze/index.js.map +1 -1
- package/build/cliProgram.js +733 -0
- package/build/cliProgram.js.map +1 -0
- package/build/completion/index.js +247 -382
- package/build/completion/index.js.map +1 -1
- package/build/completion/introspect.js +17 -0
- package/build/completion/introspect.js.map +1 -0
- package/build/config/applicationConfig.js +3 -2
- package/build/config/applicationConfig.js.map +1 -1
- package/build/cs_mast/index.js +18 -17
- package/build/cs_mast/index.js.map +1 -1
- package/build/endpoints/gen_report/gen_json.js +2 -2
- package/build/endpoints/gen_report/gen_json.js.map +1 -1
- package/build/endpoints/gen_report/utility/iterate_n_store.js +1 -1
- package/build/endpoints/gen_report/utility/iterate_n_store.js.map +1 -1
- package/build/endpoints/index.js +12 -12
- package/build/endpoints/index.js.map +1 -1
- package/build/endpoints/next_js/client_jsFilesHref.js +3 -3
- package/build/endpoints/next_js/client_jsFilesHref.js.map +1 -1
- package/build/endpoints/next_js/client_jsonParse.js +4 -4
- package/build/endpoints/next_js/client_jsonParse.js.map +1 -1
- package/build/endpoints/next_js/client_mappedJsonFile.js +6 -6
- package/build/endpoints/next_js/client_mappedJsonFile.js.map +1 -1
- package/build/endpoints/next_js/client_subsequentRequests.js +5 -5
- package/build/endpoints/next_js/client_subsequentRequests.js.map +1 -1
- package/build/exploit/angular/cve-2026-68945.js +61 -0
- package/build/exploit/angular/cve-2026-68945.js.map +1 -0
- package/build/exploit/index.js +60 -0
- package/build/exploit/index.js.map +1 -0
- package/build/exploit/next/cve-2025-29927.js +65 -0
- package/build/exploit/next/cve-2025-29927.js.map +1 -0
- package/build/exploit/next/cve-2026-64645.js +51 -0
- package/build/exploit/next/cve-2026-64645.js.map +1 -0
- package/build/exploit/nuxt/cve-2026-71315.js +47 -0
- package/build/exploit/nuxt/cve-2026-71315.js.map +1 -0
- package/build/exploit/nuxt/cve-2026-71320.js +114 -0
- package/build/exploit/nuxt/cve-2026-71320.js.map +1 -0
- package/build/exploit/react/cve-2025-55182.js +116 -0
- package/build/exploit/react/cve-2025-55182.js.map +1 -0
- package/build/exploit/registry/cveRegistry.js +115 -0
- package/build/exploit/registry/cveRegistry.js.map +1 -0
- package/build/exploit/types.js +2 -0
- package/build/exploit/types.js.map +1 -0
- package/build/exploit/utility/compareResponses.js +29 -0
- package/build/exploit/utility/compareResponses.js.map +1 -0
- package/build/exploit/utility/outputHelper.js +22 -0
- package/build/exploit/utility/outputHelper.js.map +1 -0
- package/build/exploit/utility/rawRequest.js +56 -0
- package/build/exploit/utility/rawRequest.js.map +1 -0
- package/build/exploit/utility/sandboxRce.js +49 -0
- package/build/exploit/utility/sandboxRce.js.map +1 -0
- package/build/exploit/utility/toEngineOutput.js +28 -0
- package/build/exploit/utility/toEngineOutput.js.map +1 -0
- package/build/exploit/utility/wsClient.js +78 -0
- package/build/exploit/utility/wsClient.js.map +1 -0
- package/build/exploit/vite/cve-2025-30208.js +44 -0
- package/build/exploit/vite/cve-2025-30208.js.map +1 -0
- package/build/exploit/vite/cve-2026-39363.js +60 -0
- package/build/exploit/vite/cve-2026-39363.js.map +1 -0
- package/build/fingerprint/index.js +3 -2
- package/build/fingerprint/index.js.map +1 -1
- package/build/globalConfig.js +2 -2
- package/build/globalConfig.js.map +1 -1
- package/build/index.js +5 -596
- package/build/index.js.map +1 -1
- package/build/lazyLoad/angular/angular_getFromPageSource.js +3 -3
- package/build/lazyLoad/angular/angular_getFromPageSource.js.map +1 -1
- package/build/lazyLoad/downloadFilesUtil.js +14 -11
- package/build/lazyLoad/downloadFilesUtil.js.map +1 -1
- package/build/lazyLoad/downloadQueue.js +9 -1
- package/build/lazyLoad/downloadQueue.js.map +1 -1
- package/build/lazyLoad/downloadResponse.js +1 -0
- package/build/lazyLoad/downloadResponse.js.map +1 -1
- package/build/lazyLoad/generic/generic_crawlPages.js +186 -0
- package/build/lazyLoad/generic/generic_crawlPages.js.map +1 -0
- package/build/lazyLoad/generic/generic_downloadFiles.js +81 -0
- package/build/lazyLoad/generic/generic_downloadFiles.js.map +1 -0
- package/build/lazyLoad/generic/generic_extractLinks.js +79 -0
- package/build/lazyLoad/generic/generic_extractLinks.js.map +1 -0
- package/build/lazyLoad/generic/generic_getScriptTags.js +152 -0
- package/build/lazyLoad/generic/generic_getScriptTags.js.map +1 -0
- package/build/lazyLoad/generic/generic_importMapDiscovery.js +87 -0
- package/build/lazyLoad/generic/generic_importMapDiscovery.js.map +1 -0
- package/build/lazyLoad/generic/generic_resolveScope.js +66 -0
- package/build/lazyLoad/generic/generic_resolveScope.js.map +1 -0
- package/build/lazyLoad/generic/generic_scanAttributesForJs.js +122 -0
- package/build/lazyLoad/generic/generic_scanAttributesForJs.js.map +1 -0
- package/build/lazyLoad/generic/generic_stringsDiscovery.js +103 -0
- package/build/lazyLoad/generic/generic_stringsDiscovery.js.map +1 -0
- package/build/lazyLoad/generic/generic_webpackChunkPaths.js +56 -0
- package/build/lazyLoad/generic/generic_webpackChunkPaths.js.map +1 -0
- package/build/lazyLoad/globals.js +31 -0
- package/build/lazyLoad/globals.js.map +1 -1
- package/build/lazyLoad/index.js +172 -75
- package/build/lazyLoad/index.js.map +1 -1
- package/build/lazyLoad/methodFilter.js +9 -1
- package/build/lazyLoad/methodFilter.js.map +1 -1
- package/build/lazyLoad/next_js/NextJsCrawler.js +98 -14
- package/build/lazyLoad/next_js/NextJsCrawler.js.map +1 -1
- package/build/lazyLoad/next_js/next_GetJSScript.js +3 -3
- package/build/lazyLoad/next_js/next_GetJSScript.js.map +1 -1
- package/build/lazyLoad/next_js/next_GetLazyResourcesBuildManifestJs.js +4 -4
- package/build/lazyLoad/next_js/next_GetLazyResourcesBuildManifestJs.js.map +1 -1
- package/build/lazyLoad/next_js/next_GetLazyResourcesWebpackJs.js +17 -11
- package/build/lazyLoad/next_js/next_GetLazyResourcesWebpackJs.js.map +1 -1
- package/build/lazyLoad/next_js/next_SubsequentRequests.js +7 -6
- package/build/lazyLoad/next_js/next_SubsequentRequests.js.map +1 -1
- package/build/lazyLoad/next_js/next_bruteForceJsFiles.js +1 -1
- package/build/lazyLoad/next_js/next_bruteForceJsFiles.js.map +1 -1
- package/build/lazyLoad/next_js/next_buildId.js +2 -2
- package/build/lazyLoad/next_js/next_buildId.js.map +1 -1
- package/build/lazyLoad/next_js/next_getClientSidePaths.js +2 -2
- package/build/lazyLoad/next_js/next_getClientSidePaths.js.map +1 -1
- package/build/lazyLoad/next_js/next_parseLayoutJs.js +6 -6
- package/build/lazyLoad/next_js/next_parseLayoutJs.js.map +1 -1
- package/build/lazyLoad/next_js/next_promiseResolve.js +1 -1
- package/build/lazyLoad/next_js/next_promiseResolve.js.map +1 -1
- package/build/lazyLoad/next_js/next_routerStateForge.js +407 -0
- package/build/lazyLoad/next_js/next_routerStateForge.js.map +1 -0
- package/build/lazyLoad/next_js/next_scriptTagsSubsequentRequests.js +1 -1
- package/build/lazyLoad/next_js/next_scriptTagsSubsequentRequests.js.map +1 -1
- package/build/lazyLoad/next_js/next_serverActionIdScan.js +77 -0
- package/build/lazyLoad/next_js/next_serverActionIdScan.js.map +1 -0
- package/build/lazyLoad/nuxt_js/nuxt_astParse.js +15 -13
- package/build/lazyLoad/nuxt_js/nuxt_astParse.js.map +1 -1
- package/build/lazyLoad/nuxt_js/nuxt_getBuildsManifest.js +2 -2
- package/build/lazyLoad/nuxt_js/nuxt_getBuildsManifest.js.map +1 -1
- package/build/lazyLoad/nuxt_js/nuxt_getFromPageSource.js +3 -3
- package/build/lazyLoad/nuxt_js/nuxt_getFromPageSource.js.map +1 -1
- package/build/lazyLoad/nuxt_js/nuxt_stringAnalysisJSFiles.js +29 -5
- package/build/lazyLoad/nuxt_js/nuxt_stringAnalysisJSFiles.js.map +1 -1
- package/build/lazyLoad/react/react_sourcemapUrls.js +7 -28
- package/build/lazyLoad/react/react_sourcemapUrls.js.map +1 -1
- package/build/lazyLoad/react/react_webpackChunkPaths.js +10 -202
- package/build/lazyLoad/react/react_webpackChunkPaths.js.map +1 -1
- package/build/lazyLoad/researchUtils.js +15 -0
- package/build/lazyLoad/researchUtils.js.map +1 -0
- package/build/lazyLoad/shared/webpackChunkParsers.js +218 -0
- package/build/lazyLoad/shared/webpackChunkParsers.js.map +1 -0
- package/build/lazyLoad/sourcemap.js +120 -0
- package/build/lazyLoad/sourcemap.js.map +1 -1
- package/build/lazyLoad/stagnation/stagnationMonitor.js +63 -0
- package/build/lazyLoad/stagnation/stagnationMonitor.js.map +1 -0
- package/build/lazyLoad/svelte/svelte_discoverPagesFromJs.js +1 -0
- package/build/lazyLoad/svelte/svelte_discoverPagesFromJs.js.map +1 -1
- package/build/lazyLoad/svelte/svelte_getFromPageSource.js +5 -5
- package/build/lazyLoad/svelte/svelte_getFromPageSource.js.map +1 -1
- package/build/lazyLoad/svelte/svelte_getVersionJson.js +2 -2
- package/build/lazyLoad/svelte/svelte_getVersionJson.js.map +1 -1
- package/build/lazyLoad/svelte/svelte_recursivePageCrawl.js +6 -6
- package/build/lazyLoad/svelte/svelte_recursivePageCrawl.js.map +1 -1
- package/build/lazyLoad/svelte/svelte_stringAnalysisJSFiles.js +15 -6
- package/build/lazyLoad/svelte/svelte_stringAnalysisJSFiles.js.map +1 -1
- package/build/lazyLoad/techDetect/checkAngularJS.js +1 -1
- package/build/lazyLoad/techDetect/checkAngularJS.js.map +1 -1
- package/build/lazyLoad/techDetect/checkNuxtJS.js +3 -3
- package/build/lazyLoad/techDetect/checkNuxtJS.js.map +1 -1
- package/build/lazyLoad/techDetect/checkSvelte.js +0 -1
- package/build/lazyLoad/techDetect/checkSvelte.js.map +1 -1
- package/build/lazyLoad/techDetect/checkVueJS.js +6 -6
- package/build/lazyLoad/techDetect/checkVueJS.js.map +1 -1
- package/build/lazyLoad/techDetect/index.js +17 -1
- package/build/lazyLoad/techDetect/index.js.map +1 -1
- package/build/lazyLoad/vue/vue_SingleJsFileOnHome.js +2 -2
- package/build/lazyLoad/vue/vue_SingleJsFileOnHome.js.map +1 -1
- package/build/lazyLoad/vue/vue_discoverJsFiles.js +13 -11
- package/build/lazyLoad/vue/vue_discoverJsFiles.js.map +1 -1
- package/build/lazyLoad/vue/vue_getClientSidePaths.js +1 -1
- package/build/lazyLoad/vue/vue_getClientSidePaths.js.map +1 -1
- package/build/lazyLoad/vue/vue_pageSrc.js +1 -1
- package/build/lazyLoad/vue/vue_pageSrc.js.map +1 -1
- package/build/lazyLoad/vue/vue_reconstructSourceMaps.js +12 -3
- package/build/lazyLoad/vue/vue_reconstructSourceMaps.js.map +1 -1
- package/build/lazyLoad/vue/vue_recursiveClientSidePathDownload.js +2 -2
- package/build/lazyLoad/vue/vue_recursiveClientSidePathDownload.js.map +1 -1
- package/build/lazyLoad/vue/vue_severalJsFilesHome.js +3 -3
- package/build/lazyLoad/vue/vue_severalJsFilesHome.js.map +1 -1
- package/build/load/index.js +28 -38
- package/build/load/index.js.map +1 -1
- package/build/map/angular_js/getAngularConnections.js +6 -6
- package/build/map/angular_js/getAngularConnections.js.map +1 -1
- package/build/map/graphql/resolveGraphql.js +6 -6
- package/build/map/graphql/resolveGraphql.js.map +1 -1
- package/build/map/index.js +17 -17
- package/build/map/index.js.map +1 -1
- package/build/map/interactive-mode/commandHandler.js +278 -0
- package/build/map/interactive-mode/commandHandler.js.map +1 -0
- package/build/map/interactive-mode/commandHelpers.js +189 -0
- package/build/map/interactive-mode/commandHelpers.js.map +1 -0
- package/build/map/interactive-mode/esqueryGen.js.map +1 -0
- package/build/map/interactive-mode/helpMenu.js +11 -0
- package/build/map/interactive-mode/helpMenu.js.map +1 -0
- package/build/map/interactive-mode/inputPatch.js.map +1 -0
- package/build/map/interactive-mode/interactive.js +71 -0
- package/build/map/interactive-mode/interactive.js.map +1 -0
- package/build/map/interactive-mode/keybindings.js.map +1 -0
- package/build/map/interactive-mode/printer.js.map +1 -0
- package/build/map/interactive-mode/ui.js.map +1 -0
- package/build/map/next_js/getAxiosInstances.js +5 -5
- package/build/map/next_js/getAxiosInstances.js.map +1 -1
- package/build/map/next_js/getExports.js +4 -4
- package/build/map/next_js/getExports.js.map +1 -1
- package/build/map/next_js/getFetchInstances.js +10 -10
- package/build/map/next_js/getFetchInstances.js.map +1 -1
- package/build/map/next_js/getTurbopackConnections.js +8 -8
- package/build/map/next_js/getTurbopackConnections.js.map +1 -1
- package/build/map/next_js/getWebpackConnections.js +27 -16
- package/build/map/next_js/getWebpackConnections.js.map +1 -1
- package/build/map/next_js/interactive.js +3 -65
- package/build/map/next_js/interactive.js.map +1 -1
- package/build/map/next_js/interactive_helpers/commandHandler.js +38 -290
- package/build/map/next_js/interactive_helpers/commandHandler.js.map +1 -1
- package/build/map/next_js/interactive_helpers/commandHelpers.js +0 -184
- package/build/map/next_js/interactive_helpers/commandHelpers.js.map +1 -1
- package/build/map/next_js/interactive_helpers/helpMenu.js +2 -10
- package/build/map/next_js/interactive_helpers/helpMenu.js.map +1 -1
- package/build/map/next_js/resolveAxios.js +6 -6
- package/build/map/next_js/resolveAxios.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/findAxiosClients.js +4 -4
- package/build/map/next_js/resolveAxiosHelpers/findAxiosClients.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/findAxiosInstance.js +2 -2
- package/build/map/next_js/resolveAxiosHelpers/findAxiosInstance.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/findCrossChunkParams.js +5 -5
- package/build/map/next_js/resolveAxiosHelpers/findCrossChunkParams.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/handleAxiosCreate.js +10 -10
- package/build/map/next_js/resolveAxiosHelpers/handleAxiosCreate.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/handleZDotCreate.js +13 -9
- package/build/map/next_js/resolveAxiosHelpers/handleZDotCreate.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/processAxiosCall.js +12 -8
- package/build/map/next_js/resolveAxiosHelpers/processAxiosCall.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/processDirectAxiosCall.js +12 -8
- package/build/map/next_js/resolveAxiosHelpers/processDirectAxiosCall.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/processExportedEndpoints.js +11 -11
- package/build/map/next_js/resolveAxiosHelpers/processExportedEndpoints.js.map +1 -1
- package/build/map/next_js/resolveAxiosHelpers/traceAxiosInstanceExports.js +16 -16
- package/build/map/next_js/resolveAxiosHelpers/traceAxiosInstanceExports.js.map +1 -1
- package/build/map/next_js/resolveFetch.js +23 -23
- package/build/map/next_js/resolveFetch.js.map +1 -1
- package/build/map/next_js/resolveNewRequest.js +10 -10
- package/build/map/next_js/resolveNewRequest.js.map +1 -1
- package/build/map/next_js/resolveServerActions.js +4 -4
- package/build/map/next_js/resolveServerActions.js.map +1 -1
- package/build/map/next_js/utils.js +8 -2
- package/build/map/next_js/utils.js.map +1 -1
- package/build/map/react_js/getReactConnections.js +21 -14
- package/build/map/react_js/getReactConnections.js.map +1 -1
- package/build/map/svelte_js/interactive.js +3 -54
- package/build/map/svelte_js/interactive.js.map +1 -1
- package/build/map/vue_js/getViteConnections.js +23 -16
- package/build/map/vue_js/getViteConnections.js.map +1 -1
- package/build/map/vue_js/interactive.js +3 -63
- package/build/map/vue_js/interactive.js.map +1 -1
- package/build/map/vue_js/interactive_helpers/commandHandler.js +34 -283
- package/build/map/vue_js/interactive_helpers/commandHandler.js.map +1 -1
- package/build/map/vue_js/interactive_helpers/helpMenu.js +2 -10
- package/build/map/vue_js/interactive_helpers/helpMenu.js.map +1 -1
- package/build/map/vue_js/taint_utils.js +1 -1
- package/build/map/vue_js/taint_utils.js.map +1 -1
- package/build/map/vue_js/vue_resolveFetch.js +12 -12
- package/build/map/vue_js/vue_resolveFetch.js.map +1 -1
- package/build/map/vue_js/vue_resolveHttpClient.js +18 -18
- package/build/map/vue_js/vue_resolveHttpClient.js.map +1 -1
- package/build/map/vue_js/vue_resolveXhr.js +11 -11
- package/build/map/vue_js/vue_resolveXhr.js.map +1 -1
- package/build/mcp/chatOneShot.js +7 -7
- package/build/mcp/chatOneShot.js.map +1 -1
- package/build/mcp/claudeCodeCreds.js +5 -5
- package/build/mcp/claudeCodeCreds.js.map +1 -1
- package/build/mcp/cli.js +36 -35
- package/build/mcp/cli.js.map +1 -1
- package/build/mcp/config.js +4 -4
- package/build/mcp/config.js.map +1 -1
- package/build/mcp/index.js +7 -7
- package/build/mcp/index.js.map +1 -1
- package/build/mcp/mcpServer.js +4 -3
- package/build/mcp/mcpServer.js.map +1 -1
- package/build/mcp/skills.js +1 -0
- package/build/mcp/skills.js.map +1 -1
- package/build/mcp/tools.js +6 -5
- package/build/mcp/tools.js.map +1 -1
- package/build/proxy/detectBlockedResponse.js +2 -0
- package/build/proxy/detectBlockedResponse.js.map +1 -1
- package/build/proxy/index.js +3 -3
- package/build/proxy/index.js.map +1 -1
- package/build/refactor/index.js +83 -79
- package/build/refactor/index.js.map +1 -1
- package/build/refactor/next/index.js +69 -26
- package/build/refactor/next/index.js.map +1 -1
- package/build/refactor/next/transform.js +11 -4
- package/build/refactor/next/transform.js.map +1 -1
- package/build/refactor/next/validator.js +7 -7
- package/build/refactor/next/validator.js.map +1 -1
- package/build/refactor/react/index.js +13 -13
- package/build/refactor/react/index.js.map +1 -1
- package/build/refactor/react/validator.js +7 -7
- package/build/refactor/react/validator.js.map +1 -1
- package/build/refactor/react-vite/index.js +3 -3
- package/build/refactor/react-vite/index.js.map +1 -1
- package/build/refactor/remote/hf-client.js +1 -0
- package/build/refactor/remote/hf-client.js.map +1 -1
- package/build/refactor/remote/version-detect.js +12 -12
- package/build/refactor/remote/version-detect.js.map +1 -1
- package/build/refactor/vue/index.js +6 -6
- package/build/refactor/vue/index.js.map +1 -1
- package/build/refactor/vue/vite.js +6 -6
- package/build/refactor/vue/vite.js.map +1 -1
- package/build/report/index.js +30 -8
- package/build/report/index.js.map +1 -1
- package/build/report/swaggerJacker.js +63 -0
- package/build/report/swaggerJacker.js.map +1 -0
- package/build/report/utility/dataTables/genDataTablesPage.js +2 -1
- package/build/report/utility/dataTables/genDataTablesPage.js.map +1 -1
- package/build/report/utility/genHtml.js +316 -25
- package/build/report/utility/genHtml.js.map +1 -1
- package/build/report/utility/markdownGen/addAnalyze.js +2 -1
- package/build/report/utility/markdownGen/addAnalyze.js.map +1 -1
- package/build/report/utility/populateDb/populateAnalysisFindings.js +2 -2
- package/build/report/utility/populateDb/populateAnalysisFindings.js.map +1 -1
- package/build/report/utility/populateDb/populateEndpoints.js +3 -3
- package/build/report/utility/populateDb/populateEndpoints.js.map +1 -1
- package/build/report/utility/populateDb/populateMappedJson.js +2 -2
- package/build/report/utility/populateDb/populateMappedJson.js.map +1 -1
- package/build/report/utility/populateDb/populateMappedOpenapi.js +3 -3
- package/build/report/utility/populateDb/populateMappedOpenapi.js.map +1 -1
- package/build/report/utility/severityColors.js +35 -0
- package/build/report/utility/severityColors.js.map +1 -0
- package/build/run/bundler-detect.js +45 -9
- package/build/run/bundler-detect.js.map +1 -1
- package/build/run/dashboard/dashboardHtml.js +150 -0
- package/build/run/dashboard/dashboardHtml.js.map +1 -0
- package/build/run/dashboard/fsBrowser.js +43 -0
- package/build/run/dashboard/fsBrowser.js.map +1 -0
- package/build/run/dashboard/server.js +123 -0
- package/build/run/dashboard/server.js.map +1 -0
- package/build/run/dashboard/state.js +97 -0
- package/build/run/dashboard/state.js.map +1 -0
- package/build/run/index.js +177 -110
- package/build/run/index.js.map +1 -1
- package/build/run/interruptHandler.js +18 -0
- package/build/run/interruptHandler.js.map +1 -1
- package/build/sourcemaps/index.js +7 -6
- package/build/sourcemaps/index.js.map +1 -1
- package/build/strings/index.js +27 -24
- package/build/strings/index.js.map +1 -1
- package/build/strings/openapi.js +4 -4
- package/build/strings/openapi.js.map +1 -1
- package/build/strings/permutate.js +4 -4
- package/build/strings/permutate.js.map +1 -1
- package/build/strings/secrets.js +1 -0
- package/build/strings/secrets.js.map +1 -1
- package/build/strings/trufflehog.js +66 -19
- package/build/strings/trufflehog.js.map +1 -1
- package/build/strings/trufflehogConfig.js +36 -0
- package/build/strings/trufflehogConfig.js.map +1 -0
- package/build/strings/trufflehogDownload.js +115 -0
- package/build/strings/trufflehogDownload.js.map +1 -0
- package/build/utility/ai.js +33 -4
- package/build/utility/ai.js.map +1 -1
- package/build/utility/banner.js +4 -3
- package/build/utility/banner.js.map +1 -1
- package/build/utility/cacheDb.js +78 -0
- package/build/utility/cacheDb.js.map +1 -0
- package/build/utility/configureSandbox.js +2 -2
- package/build/utility/configureSandbox.js.map +1 -1
- package/build/utility/customHeaders.js +30 -0
- package/build/utility/customHeaders.js.map +1 -0
- package/build/utility/globals.js +37 -12
- package/build/utility/globals.js.map +1 -1
- package/build/utility/heap.js +2 -1
- package/build/utility/heap.js.map +1 -1
- package/build/utility/makeReq.js +38 -87
- package/build/utility/makeReq.js.map +1 -1
- package/build/utility/openapiGenerator.js +2 -2
- package/build/utility/openapiGenerator.js.map +1 -1
- package/build/utility/printMsg.js +53 -0
- package/build/utility/printMsg.js.map +1 -0
- package/build/utility/progressLog.js +4 -3
- package/build/utility/progressLog.js.map +1 -1
- package/build/utility/resolvePath.js +2 -1
- package/build/utility/resolvePath.js.map +1 -1
- package/build/utility/ruleVersionMap.js +73 -0
- package/build/utility/ruleVersionMap.js.map +1 -0
- package/config.dist.yaml +3 -3
- package/contributing/testing.md +106 -0
- package/eslint.config.js +24 -0
- package/package.json +22 -6
- package/scripts/exploit-smoke-test.js +82 -0
- package/scripts/framework-detect-smoke-test.js +64 -0
- package/scripts/postinstall-completion.mjs +40 -0
- package/scripts/smoke-test.js +12 -0
- package/build/lazyLoad/downloadLoadedJsUtil.js +0 -98
- package/build/lazyLoad/downloadLoadedJsUtil.js.map +0 -1
- package/build/map/next_js/interactive_helpers/esqueryGen.js.map +0 -1
- package/build/map/next_js/interactive_helpers/inputPatch.js.map +0 -1
- package/build/map/next_js/interactive_helpers/keybindings.js.map +0 -1
- package/build/map/next_js/interactive_helpers/printer.js.map +0 -1
- package/build/map/next_js/interactive_helpers/ui.js.map +0 -1
- /package/build/map/{next_js/interactive_helpers → interactive-mode}/esqueryGen.js +0 -0
- /package/build/map/{next_js/interactive_helpers → interactive-mode}/inputPatch.js +0 -0
- /package/build/map/{next_js/interactive_helpers → interactive-mode}/keybindings.js +0 -0
- /package/build/map/{next_js/interactive_helpers → interactive-mode}/printer.js +0 -0
- /package/build/map/{next_js/interactive_helpers → interactive-mode}/ui.js +0 -0
package/.plumber.yaml
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Plumber configuration (https://github.com/getplumber/plumber)
|
|
2
|
+
# See js-recon-internal-docs/docs/dev-workflow/plumber-security-scanning.md for details.
|
|
3
|
+
|
|
4
|
+
version: "2.0"
|
|
5
|
+
github:
|
|
6
|
+
controls:
|
|
7
|
+
containerImageMustNotUseForbiddenTags:
|
|
8
|
+
enabled: true
|
|
9
|
+
tags:
|
|
10
|
+
- latest
|
|
11
|
+
- dev
|
|
12
|
+
- development
|
|
13
|
+
- staging
|
|
14
|
+
- main
|
|
15
|
+
- master
|
|
16
|
+
containerImagesMustBePinnedByDigest: true
|
|
17
|
+
branchMustBeProtected:
|
|
18
|
+
enabled: false # disabled: enabling real GitHub branch protection is a separate follow-up (would need to allow-list bot/PAT push automation first)
|
|
19
|
+
namePatterns:
|
|
20
|
+
- main
|
|
21
|
+
- dev
|
|
22
|
+
defaultMustBeProtected: true
|
|
23
|
+
allowForcePush: false
|
|
24
|
+
codeOwnerApprovalRequired: false
|
|
25
|
+
externalRefsMustNotCollide:
|
|
26
|
+
enabled: true
|
|
27
|
+
pipelineMustNotEnableDebugTrace:
|
|
28
|
+
enabled: true
|
|
29
|
+
forbiddenVariables:
|
|
30
|
+
- ACTIONS_STEP_DEBUG
|
|
31
|
+
- ACTIONS_RUNNER_DEBUG
|
|
32
|
+
securityJobsMustNotBeWeakened:
|
|
33
|
+
enabled: true
|
|
34
|
+
securityJobPatterns:
|
|
35
|
+
- "*codeql*"
|
|
36
|
+
- "*dependency-review*"
|
|
37
|
+
- "*trufflehog*"
|
|
38
|
+
- "*gitleaks*"
|
|
39
|
+
- "*osv-scanner*"
|
|
40
|
+
- "*-sast"
|
|
41
|
+
- "*-sast-*"
|
|
42
|
+
- "*-scan"
|
|
43
|
+
- "*scan*"
|
|
44
|
+
- "*-security"
|
|
45
|
+
- "*-security-*"
|
|
46
|
+
- "*-audit"
|
|
47
|
+
- "*-audit-*"
|
|
48
|
+
allowFailureMustBeFalse:
|
|
49
|
+
enabled: false
|
|
50
|
+
rulesMustNotBeRedefined:
|
|
51
|
+
enabled: false
|
|
52
|
+
whenMustNotBeManual:
|
|
53
|
+
enabled: false
|
|
54
|
+
pipelineMustNotUseDockerInDocker:
|
|
55
|
+
enabled: true
|
|
56
|
+
detectInsecureDaemon: true
|
|
57
|
+
actionsMustBePinnedByCommitSha:
|
|
58
|
+
enabled: true
|
|
59
|
+
trustedOwners:
|
|
60
|
+
- actions
|
|
61
|
+
- github
|
|
62
|
+
githubActionMustComeFromAuthorizedSources:
|
|
63
|
+
enabled: true
|
|
64
|
+
trustGithubOfficialActions: true
|
|
65
|
+
trustSameOrgActions: true
|
|
66
|
+
trustedGithubActions:
|
|
67
|
+
- shriyanss/verified-commit-action
|
|
68
|
+
- docker/login-action
|
|
69
|
+
- getplumber/plumber
|
|
70
|
+
workflowMustNotInjectUserInputInScripts:
|
|
71
|
+
enabled: true
|
|
72
|
+
workflowMustNotWriteUntrustedContentToGitHubEnv:
|
|
73
|
+
enabled: true
|
|
74
|
+
workflowMustNotUseDangerousTriggers:
|
|
75
|
+
enabled: true
|
|
76
|
+
pullRequestTargetMustNotCheckoutHead:
|
|
77
|
+
enabled: true
|
|
78
|
+
workflowsMustDeclarePermissions:
|
|
79
|
+
enabled: true
|
|
80
|
+
reusableWorkflowsMustNotInheritSecrets:
|
|
81
|
+
enabled: true
|
|
82
|
+
workflowMustNotExportEntireSecretsContext:
|
|
83
|
+
enabled: true
|
|
84
|
+
workflowMustNotGrantPermissionsWriteAll:
|
|
85
|
+
enabled: true
|
|
86
|
+
actionsMustNotBeArchived:
|
|
87
|
+
enabled: true
|
|
88
|
+
actionRefsMustExistUpstream:
|
|
89
|
+
enabled: true
|
|
90
|
+
actionsMustNotCarryKnownCVEs:
|
|
91
|
+
enabled: true
|
|
92
|
+
actionsMustNotExecuteMutableRemoteCode:
|
|
93
|
+
enabled: true
|
|
94
|
+
releaseWorkflowsMustNotRestoreUntrustedCache:
|
|
95
|
+
enabled: true
|
|
96
|
+
publishActions:
|
|
97
|
+
- pypa/gh-action-pypi-publish
|
|
98
|
+
- JS-DevTools/npm-publish
|
|
99
|
+
- gradle/publish-plugin
|
|
100
|
+
- softprops/action-gh-release
|
|
101
|
+
- ncipollo/release-action
|
|
102
|
+
- goreleaser/goreleaser-action
|
|
103
|
+
- crazy-max/ghaction-docker-buildx
|
|
104
|
+
- changesets/action
|
|
105
|
+
cacheActions:
|
|
106
|
+
- action: actions/cache
|
|
107
|
+
mode: always
|
|
108
|
+
- action: actions/cache/restore
|
|
109
|
+
mode: always
|
|
110
|
+
- action: Swatinem/rust-cache
|
|
111
|
+
mode: always
|
|
112
|
+
- action: actions/setup-go
|
|
113
|
+
mode: default
|
|
114
|
+
disableInput: cache
|
|
115
|
+
disableValue: false
|
|
116
|
+
- action: gradle/actions/setup-gradle
|
|
117
|
+
mode: default
|
|
118
|
+
disableInput: cache-disabled
|
|
119
|
+
disableValue: true
|
|
120
|
+
- action: actions/setup-node
|
|
121
|
+
mode: opt-in
|
|
122
|
+
enableInput: cache
|
|
123
|
+
- action: actions/setup-python
|
|
124
|
+
mode: opt-in
|
|
125
|
+
enableInput: cache
|
|
126
|
+
- action: actions/setup-java
|
|
127
|
+
mode: opt-in
|
|
128
|
+
enableInput: cache
|
|
129
|
+
- action: pnpm/action-setup
|
|
130
|
+
mode: opt-in
|
|
131
|
+
enableInput: cache
|
|
132
|
+
- action: docker/build-push-action
|
|
133
|
+
mode: opt-in
|
|
134
|
+
enableInput: cache-from
|
|
135
|
+
enableContains: type=gha
|
|
136
|
+
publishScriptPatterns:
|
|
137
|
+
- (?i)(npm|pnpm|yarn|bun)\s+publish
|
|
138
|
+
- (?i)cargo\s+publish
|
|
139
|
+
- (?i)twine\s+upload
|
|
140
|
+
- (?i)poetry\s+publish
|
|
141
|
+
- (?i)gh\s+release\s+create
|
|
142
|
+
- (?i)goreleaser\s+release
|
|
143
|
+
- (?i)semantic-release
|
|
144
|
+
- (?i)gradlew?\b[^\n]*\bpublish
|
|
145
|
+
- (?i)\bmvnw?\b[^\n]*\bdeploy\b
|
|
146
|
+
- (?i)dotnet\s+nuget\s+push
|
|
147
|
+
- (?i)gem\s+push
|
|
148
|
+
- (?i)docker\s+push
|
|
149
|
+
publishScriptExcludePatterns:
|
|
150
|
+
- (?i)--dry-run
|
|
151
|
+
- (?i)publishToMavenLocal
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.0.1-alpha.2 - 2026-08-12
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- The response cache (`makeReq.ts`) is now backed by a single SQLite file (`.resp_cache.db`, via the existing `better-sqlite3` dependency) instead of the previous two coexisting JSON formats — a legacy whole-file cache and a later per-entry sidecar directory (`<file>.entries/<digest>.json`). One row per URL/request-header identity digest replaces both; lookups and writes go through a lazily-opened, path-keyed singleton connection (`src/utility/cacheDb.ts`) rather than synchronous `fs` calls on every request. This is a clean break, not an in-place migration: an existing `.resp_cache.json`/`.entries/` directory from a prior version is left untouched but never read again — the first run after upgrading simply starts with an empty cache, which is the intended (and only) migration path, matching how cache-write failures were already treated as non-fatal/best-effort. `--cache-file`'s default changed accordingly, from `.resp_cache.json` to `.resp_cache.db` (`lazyload`, `run`, `load`, `mcp`).
|
|
8
|
+
- `load` (Caido/Burp import) now writes each imported entry directly into the SQLite cache instead of building one large in-memory JSON object and serializing it in a single `fs.writeFileSync` at the end. This also removes the "cache too large to serialize as one JSON string" `RangeError` failure mode entirely — SQLite has no equivalent whole-file size ceiling. (`load`)
|
|
9
|
+
- `lazyload`'s cache pre-creation step now opens the SQLite cache DB up front (which also creates it and its schema if missing) instead of writing an empty `{}` JSON stub; a failure to open it is now a fatal error with a dedicated exit code (`32`), since this step's entire purpose is ensuring a writable cache exists before the crawl starts. (`lazyload`)
|
|
10
|
+
|
|
11
|
+
### Security
|
|
12
|
+
|
|
13
|
+
- Removed the `fs` npm package from dependencies. It was never referenced by the codebase — every `import fs from "fs"` resolves to Node's builtin module — and sat unused in `package-lock.json` as an extraneous entry. The `fs` package on npm (distinct from Node's builtin) is flagged as malicious by OSV (`MAL-2025-21003`); removing it clears the finding ahead of the new CI dependency audit below.
|
|
14
|
+
- Enabled Dependabot version updates (`.github/dependabot.yml`) for the npm, Docker, and GitHub Actions ecosystems, opening weekly PRs against `dev` so outdated dependencies surface automatically instead of only being caught at release time by `depx-audit`. Minor/patch bumps per ecosystem are grouped into a single PR; majors open individually for dedicated review.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `lazyload`/`run` now decode inline (base64 or percent-encoded) `data:` URI sourcemaps found in `//# sourceMappingURL=...` comments — e.g. Vite's `build.sourcemap: 'inline'` or webpack's `devtool: 'inline-source-map'`/`eval-source-map` — instead of treating the reference as a fetchable URL and losing the sourcemap entirely. Handled for every framework the crawler supports: React, Vue, and Svelte (which already scanned for `sourceMappingURL`) gained a `data:` branch; Next.js, Angular, and Nuxt (which had no such scanning before) gained it new, via a shared `discoverSourcemapUrls` helper (Next.js, Angular) or by extending their existing per-file string-analysis pass (Nuxt). Angular and Nuxt also gained the `extractSourceMaps` post-processing step they were missing entirely. New `next_sourcemapUrls` / `angular_sourcemapUrls` methods are visible in `--list-methods` and toggleable via `--include-methods`/`--exclude-methods`. (`lazyload`, `run`)
|
|
19
|
+
- Release CI (`publish-js-recon.yml`) now runs a `depx-audit` job before `publish-npm`: it downloads [`depx`](https://github.com/projectdiscovery/depx), verifies the binary's SHA256 against a hash pinned in the workflow, and runs `depx audit package-lock.json --require-clean` to block the release if any dependency is a known malicious package.
|
|
20
|
+
- `report.html` has a fancier, dark-mode-aware UI: a light/dark theme toggle (defaults to the OS color scheme, persisted via `localStorage`) restyles the navbar, collapsible sections, and the DataTables findings/mapped views; severity values render as colored badges in both the Home markdown view and the sortable Data Tables view. The generator also closes a gap in the "single self-contained file" contract — `highlight.js`'s code-block theme and the `marked` markdown-rendering library were previously always pulled from a CDN at view time; both are now inlined from local `node_modules` at generation time (the About page's markdown is pre-rendered server-side instead), so `report.html` no longer depends on any CDN to render correctly, including when opened directly via `file://`. (`report`)
|
|
21
|
+
- New `-H/--header <name: value>` flag for authenticated scanning: repeatable, parses each value as `Name: Value` and stores the result on a new `customHeaders` global (`src/utility/globals.ts`) rather than threading it through every request call site. `makeReq.ts`'s header-building logic (both the default-headers Referer/no-Referer retry path and the explicit-headers path) merges these in before the request goes out, so all five outbound methods — direct, SOCKS, HTTP, Oxylabs, and AWS — carry them identically, since SOCKS/HTTP/Oxylabs/direct share one dispatcher-agnostic header object and AWS reads the same object via `Object.fromEntries(new Headers(...))`. Puppeteer's initial page load (the front-end-framework crawl and tech detection) and its firewall-bypass fallback now call `page.setExtraHTTPHeaders()` before navigating, since that transport previously had no header-injection path at all. The `generic`-tech redirect-chain scope resolver and `exploit`'s raw-request helper (a separate fetch client from `makeReq.ts`) merge the same global in too, so a target requiring auth is scoped and probed correctly instead of only being crawled with it. Available on `lazyload`, `run`, and `exploit`. (`lazyload`, `run`, `exploit`)
|
|
22
|
+
|
|
23
|
+
## 2.0.1-alpha.1 - 2026-08-11
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- New Next.js `lazyload` method `next_routerStateForge`: for every route the crawl finds redirecting an unauthenticated request (a session/auth gate), it retries the route as an RSC fetch with a forged `Next-Router-State-Tree` header claiming a known ancestor path segment is already client-rendered, plus the matching `_rsc` cache-busting key (SHA-256 of the four cache-busting inputs, truncated to 96 bits, base64url — not a secret, computable from headers the client itself sends). Some Next.js apps put their only auth check inside a layout component instead of middleware; Next.js skips re-executing that layout's component function when the client's router-state claims it's already mounted, which can return the protected child content — and any JS chunk references inside that Flight payload — for a request with no session at all. A response is only treated as a hit when it's `200`, has an RSC (`text/x-component`) content type, and does not contain a `NEXT_REDIRECT` record. Runs as the crawler's final phase, after brute-force `.map` discovery; opt out per-target via `--exclude-methods next_routerStateForge`. If no full-body ancestor claim succeeds for a candidate (e.g. a tenant-scoped layout the ancestor heuristic doesn't cleanly match), the method also tries marking the leaf segment `metadata-only` instead — this narrower claim can still leak dynamic `generateMetadata()` output even where the full-body claim doesn't apply, and is reported separately from full-body hits. Every forged request now tries the cheap legacy `_rsc` key (32-bit djb2 hash, base36, 5 characters — no SHA-256 needed) before falling back to the strong key; some Next.js builds accept the legacy key as a fallback when the strong-key check fails, so this can skip the crypto step entirely, and which key mode actually worked is reported as `next_routerStateForge_legacyKeyAccepted` in `--research-output` — a signal for which build line is running, since only builds with the legacy-key fallback path accept it at all. Ancestor claims also try common dynamic-route param-name guesses (`id`, `slug`, `org`, `tenant`, `username`) for the last ancestor segment: Next.js's `matchSegment` requires an exact `[paramName, value]` tuple for a dynamic route (e.g. `app/organizations/[org]/layout.js`) — a bare string never matches one — and a black-box crawl can only observe the URL's literal value, not the app's real param name. Chunk-path extraction from a bypassed Flight payload matches the actual wire format (`static/chunks/*.js`, no `_next/` prefix — the client resolves that against its own asset prefix at runtime) rather than assuming one. (`lazyload`)
|
|
28
|
+
- `next_routerStateForge`'s dynamic-route param-name guessing is expanded from 5 names (`id`, `slug`, `org`, `tenant`, `username`) to a larger fixed set (`orgId`, `organization`, `tenantId`, `userId`, `user`, `account`, `accountId`, `workspace`, `workspaceId`, `project`, `projectId`, `team`, `teamId`, `handle`, `name`, `key`) and gains a bounded fallback: when every fixed-list guess fails for a candidate ancestor segment, the Flight/RSC response bodies already fetched during those failed attempts are scanned (no extra requests — the bodies are already paid for) for the app's real param name via two anchored patterns — a value-anchored `"key":"value"` match against the ancestor's already-known literal value (Flight serializes plain-object Client Component props this way even though the payload isn't valid JSON/JS), and a dev-mode-only pattern that reads bracketed segment names straight out of embedded webpack module source paths (`.../[paramName]/...`). This fallback only runs after the fixed list fails, and only spends extra requests if harvesting actually finds a name not already tried — new `--rsc-param-bruteforce-limit <n>` (default `20`, `0` disables the fallback) caps how many harvested names get tried per candidate URL. (`lazyload`)
|
|
29
|
+
- New Next.js `lazyload` method `next_serverActionIdScan`: after every chunk is downloaded, scans each `.js` file for `createServerReference("<id>", ...)` call sites (matching the same ID-format validation `map`'s AST-based Server Action resolver already uses, `/^[0-9a-f]{40,}$/i`, but on raw chunk text — a lightweight signal available immediately at `lazyload` time, before `map` runs its full resolution) and writes any discovered IDs to `server_action_ids.json` in the target's output directory (`{ actionIdsByFile, allActionIds }`). This is endpoint enumeration only — no action is invoked; a Server Action ID shipped in a public chunk for a page the crawl couldn't reach unauthenticated is itself a disclosure signal (the same shape as the historical CVE-2026-64643 endpoint-ID disclosure). Opt out per-target via `--exclude-methods next_serverActionIdScan`. (`lazyload`)
|
|
30
|
+
- New `exploit` subcommand: `js-recon exploit -u <url> --cve <id>` attempts exploitation of known framework CVEs to surface hidden attack surface (e.g. bypassing Next.js middleware auth reveals admin-only JS chunks a normal crawl never sees), rather than just flagging vulnerabilities. `--list-cve` prints every supported CVE grouped by framework and sorted by ID. Covers CVE-2025-29927 and CVE-2026-64645 (Next.js), CVE-2025-30208 and CVE-2026-39363 (Vite), CVE-2026-71320 and CVE-2026-71315/CVE-2026-53721 (Nuxt), CVE-2026-68945 (Angular), and CVE-2025-55182 "React2Shell" (React RSC). Findings write both a rich `exploit.json` (with any newly discovered URLs) and an `EngineOutput`-compatible file consumable by `report`'s new `--exploit-json` flag, which renders exploit findings in the existing HTML/SQLite report alongside `analyze`'s findings. Two of the eight CVEs (`CVE-2026-71320`, `CVE-2025-55182`) are RCE-class — their proof executes a real command server-side via `--exec-cmd` (default `id`); this is intentional, active exploitation, not passive detection, and should only be run against targets you're authorized to test. (`exploit`, `report`)
|
|
31
|
+
|
|
32
|
+
- `--research`/`--research-output <file>` (`lazyload`, `run`) is now supported for every framework the tool detects, not just Next.js. Vue, Nuxt, Svelte, Angular, and React crawls now record a technique-name → discovered-URL-list mapping and write it to the research output file, mirroring the existing Next.js `NextJsCrawler.techniqueEfficiencyMapping` behavior. (`lazyload`)
|
|
33
|
+
- New `generic` fallback tech in `lazyload` for sites running no supported framework: previously an undetected framework triggered a separate Puppeteer pass just to watch loaded requests and retry framework detection, and if that still found nothing the target was otherwise left with only whatever the browser happened to load. `generic` now recursively crawls the site's own `<a href>`/`<iframe src>` links, plus absolute URLs embedded in any other attribute value such as an `onclick`-driven `window.open(...)` popup (breadth-first, capped by `--max-pages`, downloading JS incrementally per page) rather than stopping at the landing page, since the JS a site's homepage references is rarely all the JS the site has. Unless `-s`/`--strict-scope` is set, the crawl's default scope is now the host reached after following redirects from `-u` (new `--max-redirects` flag, default 20) instead of the unrestricted `*` default used elsewhere. On every page, `generic` extracts `<script src>`/inline scripts/`<link rel="modulepreload">` the same way the framework crawlers do (decoding `data:` URI script sources; skipping `<script type="...">` values that indicate non-JS content, e.g. `application/ld+json`/`speculationrules`), and additionally walks every HTML attribute value, resolving each with the `URL` constructor and — for any URL with a path segment ending in `.js` (catching cachebuster-suffixed paths like `.../beacon.min.js/v124/token` that don't end in `.js` themselves) — confirms it's actually JavaScript via its response `Content-Type` (accepting `text/javascript` per RFC 9239, plus RFC 4329's now-obsoleted `application/javascript`/`application/ecmascript` and other legacy variants) rather than trusting the extension alone. `generic` is also now seeded with every request tech detection's own Puppeteer session intercepted while live-rendering the page — this catches JS requested only because a runtime-injected script asked for it (e.g. a bot-mitigation script self-injecting its own next stage via `element.innerHTML`), which no static-fetch crawl could ever see. A new `--strings` flag chains the `strings` module into the crawl to catch JS referenced only as a string literal inside an already-downloaded file (e.g. a plugin config's `"pdfWorker": "https://.../pdf.worker.js"`), resolving each extracted string against the URL the file it was found in was itself downloaded from, and recursing (`--strings-max-iterations`, default 5) until a pass finds nothing new. `run` continues to only download JS for this tech, same as any other tech outside its supported list. (`lazyload`)
|
|
34
|
+
- `generic` tech now detects content stagnation on effectively unbounded sites (blogs, news feeds) that keep serving byte-identical JS under a different, cache-busted URL on every page — a pattern the existing URL-level dedup doesn't catch, which previously burned the full `--max-pages`/`--lazyload-timeout` budget on a site whose real JS surface was already fully mapped. New flags `--stagnation-timein <mins>` (default 30, `0` disables the feature), `--stagnation-percentage <percent>` (default 80), and `--stagnation-monitor <mins>` (default 1) control a debounced check: once one content hash accounts for `--stagnation-percentage`% of everything discovered so far, the crawl arms a pending state rather than stopping immediately — if a genuinely new content hash appears within the next `--stagnation-monitor` interval, monitoring resets; only if the same dominant hash persists with no new content does the crawl stop early. New exit code 30 if `--stagnation-timein` exceeds `--lazyload-timeout`, since stagnation monitoring could then never trigger before the whole crawl times out. (`lazyload`)
|
|
35
|
+
- New `--verbose` flag (`lazyload`, `run`) gates the file-write error message previously always printed when a downloaded JS chunk fails to write to disk (`[!] Failed to write file: <path>`). It is now silent by default and only shown with `--verbose`; no other error messages are affected. (`lazyload`)
|
|
36
|
+
- New `--determine-compatible-version`/`--apply-compatible-versions` flags (`analyze`) report or auto-correct the `js_recon_version`/`js_recon_max_version` a rule file actually requires, computed from a hand-maintained map (`src/utility/ruleVersionMap.ts`) of which tool version introduced each schema/engine feature (tech values, rule types, step sub-fields). Previously rule authors had to guess the compatibility string by hand, which could under- or over-restrict a rule relative to what it actually uses. Rules also now support an optional `js_recon_max_version` field for features that have since been retired; version-compatibility mismatches reported by `--determine-compatible-version` reuse exit code 20 ("invalid rules found"), same as schema errors. (`analyze`)
|
|
37
|
+
- `run`: added `--sj`/`--sj-bin`/`--sj-args` to integrate [swagger-jacker](https://github.com/AlexPistola/swagger-jacker) against the generated OpenAPI output after `report`; also available standalone on `report`. Exits with code 31 if the `sj` binary can't be found and `--sj-bin` wasn't given. (`run`, `report`)
|
|
38
|
+
- `run`: added `--web-stats-dashboard`/`--web-stats-port` — an optional local HTTP dashboard showing live per-target progress (current step, running/completed/skipped/errored) while a batch run is in flight. (`run`)
|
|
39
|
+
- `map`/`run`: `--ai-provider` now accepts `anthropic` in addition to `openai`; the option and its API key flag are renamed `--ai-api-key` (was `--openai-api-key`) to reflect the broader provider choice. (`map`, `run`)
|
|
40
|
+
- New CI workflow `.github/workflows/framework-detection-smoke-test.yaml` runs `fingerprint` against a matrix of lab apps (Next.js, Vue, Nuxt, SvelteKit, Angular, React/Vite, React/webpack) from `js-recon-labs/detection/*` and asserts each is correctly identified, verified by the new `scripts/framework-detect-smoke-test.js`. The existing `rules-smoke-test.yaml` only exercised the rule engine against a single Next.js app; this closes the gap for tech-detection regressions across every other supported framework/bundler. Runs on push/PR to `dev`/`main` and after a release is published. (`ci`)
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- `downloadFilesUtil.ts`/`DownloadQueue` (used by every framework crawler except `generic`) determined a downloaded file's on-disk name by checking only the URL's final `/`-separated path segment for a recognized extension, with a fallback loop that scanned every segment but was unreachable in practice — it lived in a `catch` block after a regex `.match()` call that returns `undefined` on no match rather than throwing. URLs where a token or cachebuster segment follows the actual filename (e.g. `.../beacon.min.js/v124/token`) were logged as `Could not determine filename for URL: ... Skipping.` and never downloaded, even though `generic`'s own downloader already handled this exact shape. Filename resolution is now handled by dev's `getSanitizedAssetFilename`/`resolveAssetOutputDirectory` helpers (`src/utility/outputPath.ts`), which already scan every path segment for the first one ending in a recognized extension. (`lazyload`)
|
|
45
|
+
- `run`'s Ctrl-C interrupt menu could show a stray leftover message from the step that was in flight when the interrupt fired: `Promise.race` doesn't cancel the loser, so the interrupted step's own promise kept running in the background and could still call `console.log`/`console.error` while the menu/prompt was on screen, interleaving its output with the prompt. All ad-hoc `console.log`/`console.error` calls across the CLI have been replaced with a new `printMsg(MSG.Level, message)` helper (`src/utility/printMsg.ts`) that funnels every message through one call site; `run/interruptHandler.ts` now calls `lockPrintMsg()` before showing the menu and `unlockPrintMsg()` after the choice is read, so any message from an orphaned in-flight step is silently discarded instead of printing over the prompt. (`run`)
|
|
46
|
+
- `checkAssignmentExist`/`findMemberExpressionAssignment` (used by rules like `detect_postMessage_innerHtml_sink` and `detect_postMessage_function_href`) crashed `analyze`/`run` entirely with `SES_UNHANDLED_REJECTION: Couldn't find a Program` when the resolved `postMessage` handler's sensitive assignment was nested inside an `if` block. The helper called `@babel/traverse`'s scope-aware form with a raw `File`/`Program` AST node passed in place of a real `Scope` instance, which broke Babel's internal scope-chain construction for some node shapes. Fixed by traversing with `noScope: true` instead, since the helper never reads `path.scope`. (`analyze`)
|
|
47
|
+
- The response cache (`makeReq.ts`) stored a live `Headers` object directly into data later passed to `JSON.stringify()`. `Headers` has no own enumerable properties, so this silently serialized to `{}` on every cache write, discarding all response headers (not just `Content-Type`) for any URL cached earlier in a run. Any header-dependent check that hit a cached URL a second time (e.g. `generic`'s Content-Type-based JS confirmation) could silently fail depending on whether something upstream had already cached that URL. Fixed by converting to a plain object (`Object.fromEntries(headers.entries())`) before serialization. (`utility`)
|
|
48
|
+
- `checkVueJS.ts`'s last-resort tech-detection fallback scanned every externally-referenced `<script src>`, including cross-origin third-party scripts, for the substring `__vue`. A third-party widget that internally bundles Vue for its own UI could cause a site with no Vue anywhere in its own code to be misclassified as Vue.js. The fallback now only scans same-origin scripts. (`lazyload`)
|
|
49
|
+
- `strings`: a single file that fails to parse as JS (e.g. non-JS content saved with a `.js` extension) no longer aborts extraction for every other file in the scan — the parse error is now caught, logged, and skipped per-file. (`strings`)
|
|
50
|
+
- `lazyload --strings` (generic tech): each recursive strings-discovery pass rescans the same (ever-growing) output directory, since the `strings` module has no incremental-scan mode. Every already-confirmed URL from a prior pass was being re-confirmed via a fresh live `GET` request on every subsequent pass, compounding badly on large multi-hundred-page crawls. Already-known URLs are now filtered out before the Content-Type confirmation step, not after. (`lazyload`)
|
|
51
|
+
- `DownloadQueue`'s write-error log interpolated the raw error object (`${writeErr}`). For a `prettier.format()` parse failure the thrown `SyntaxError`'s message has Babel's codeframe appended after the first line, and on minified JS (a single giant line) that codeframe is the entire file — dumping the whole source to the terminal instead of just the error. The logged message is now truncated to the first line (`String(writeErr).split("\n")[0]`), e.g. `SyntaxError: Missing semicolon. (2:4)`. (`lazyload`)
|
|
52
|
+
- `map`'s per-file size guard (`MAX_MAP_FILE_SIZE_BYTES`, present identically across `getReactConnections.ts`/`getViteConnections.ts`/`getAngularConnections.ts` and the shared fetch/XHR/HTTP-client resolvers) skipped any file over 1.5 MB with no fallback chunk, so a single large un-split app bundle vanished from `mapped.json` entirely — `refactor` then ran against whatever small chunks were left instead of the app, reporting near-zero recovery. Raised the cap to 8 MB; the guard's purpose is capping the many-large-files case (ad-heavy sites), not a single reasonably-large main bundle. Also hardens `run`'s CS-MAST-S bundler detection (react-webpack vs react-vite): adds a cheap literal bundler-runtime-marker pre-check that short-circuits the structural comparison when unambiguous, and raises the random sample size to cover the current signature bucket, since undersampling could previously flip which tech "won" between identical runs against the same bundle. (`map`, `run`)
|
|
53
|
+
- The startup banner logo rendered visibly distorted (stretched, overlapping the following text) in Kitty-protocol terminals (Kitty, Ghostty). Root cause was in `@shriyanss/cli-print-img`'s Kitty renderer, which specified both `c` (columns) and `r` (rows) in the same escape sequence — per the Kitty Graphics Protocol, giving both stretches the image to fill that exact cell box instead of preserving its aspect ratio, and it also suppressed cursor movement without advancing by the actual rendered height. Bumped `@shriyanss/cli-print-img` to `1.1.1`, which fixes both issues upstream. (`cli`, `banner`)
|
|
54
|
+
- `map`'s Next.js webpack chunk-code extraction (`getWebpackConnections.ts`) stripped a chunk's numeric-ID object-literal prefix (e.g. `0:function(e,t,n){...}` → `function webpack_0(e,t,n){...}`) via two regexes that both assumed the minifier inserts whitespace between the colon/`function` keyword and the following token. Real-world minified output commonly omits that whitespace, so the prefix was left in place — invalid syntax that failed to parse downstream in `refactor -t next-webpack`, silently dropping the module instead of processing it. Also affected `refactor`'s CS-MAST library classification, since a chunk that never parses can never be checked against the signature set either. Fixed by relaxing both regexes' whitespace assumption (`\s+` → `\s*`, plus a missing `\s` escape in the arrow-form regex). Verified against a real-world target: eliminated all parse failures on a previously 96%-failing chunk set and raised its library-classification rate from ~3% to 94%. Follow-up: the arrow-form regex still required a literal `(` immediately after the numeric-ID colon, missing JS's single-parameter arrow shorthand with no parens (`3562:e=>{...}`, common in lodash-style utility functions). Fixed by matching either `(` or a bare identifier followed by `=>` via lookahead, stripping only the `id:` prefix and leaving the arrow's own param syntax untouched. (`map`)
|
|
55
|
+
|
|
56
|
+
**Note:** `post-1.4.1`'s independent proxy rework (renaming `api-gateway` to `proxy`, subcommand-per-provider design) was superseded during the `post-1.4.1` → `dev` promotion merge by `dev`'s own concurrent proxy rework, which reached the same rename via a single `proxy` command with `--proxy-method <aws|socks|http|oxylabs>` plus CloudFront/Cloudflare firewall detection, crash-safe AWS Gateway cleanup, and full test coverage — see the `1.4.1-beta.2` entry below for the proxy rename actually shipped. (`proxy`)
|
|
57
|
+
|
|
3
58
|
## 1.4.4 - 2026-08-03
|
|
4
59
|
|
|
5
60
|
### Added
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Contributing to js-recon
|
|
2
|
+
|
|
3
|
+
For the full contributor guide — cloning, branch/PR workflow, codebase structure — see
|
|
4
|
+
[js-recon.io/contributing](https://js-recon.io/contributing). This file covers the policies that
|
|
5
|
+
apply once you're making a change here.
|
|
6
|
+
|
|
7
|
+
## Testing is required for new functionality
|
|
8
|
+
|
|
9
|
+
New functionality must ship with unit and/or smoke tests. See
|
|
10
|
+
[`contributing/testing.md`](contributing/testing.md) for how to write unit tests (Vitest), fuzz
|
|
11
|
+
tests (fast-check, for anything that parses untrusted bundle input), and smoke tests (the
|
|
12
|
+
`rules-smoke-test` CI workflow).
|
|
13
|
+
|
|
14
|
+
## Keep js-recon-docs in sync
|
|
15
|
+
|
|
16
|
+
Changes that affect user-facing behavior, CLI flags, exit codes, or install/usage instructions must
|
|
17
|
+
include a corresponding update to [`js-recon-docs`](https://github.com/js-recon/js-recon-docs) —
|
|
18
|
+
either in the same PR or a linked follow-up PR. Docs-only fixes don't need a corresponding js-recon
|
|
19
|
+
change.
|
|
20
|
+
|
|
21
|
+
## Static analysis
|
|
22
|
+
|
|
23
|
+
CI runs [ESLint](https://eslint.org/) (with
|
|
24
|
+
[`eslint-plugin-security`](https://github.com/eslint-community/eslint-plugin-security)) and
|
|
25
|
+
[CodeQL](https://codeql.github.com/) on every push and pull request. Run `npm run lint` locally
|
|
26
|
+
before pushing.
|
|
27
|
+
|
|
28
|
+
## Reporting vulnerabilities
|
|
29
|
+
|
|
30
|
+
Do not open a public issue for a security vulnerability — see [`SECURITY.md`](SECURITY.md) for the
|
|
31
|
+
reporting process and response SLAs. Bug reports and feature/tech-support requests use the GitHub
|
|
32
|
+
Issues templates linked from the [contributing page](https://js-recon.io/contributing).
|
package/Dockerfile
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# JS Recon
|
|
2
2
|
|
|
3
|
-
     
|
|
3
|
+
      [](https://score.getplumber.io/github.com/js-recon/js-recon) [](https://www.bestpractices.dev/projects/13954)
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
6
|
<a href="https://js-recon.io">
|
|
@@ -139,6 +139,7 @@ js-recon --config ./operator.yaml run \
|
|
|
139
139
|
| `proxy` | Routes requests through AWS API Gateway, SOCKS5/HTTP, or Oxylabs proxies. | [Read Docs](https://js-recon.io/docs/docs/modules/proxy) |
|
|
140
140
|
| `run` | Runs all analysis modules automatically on a target. | [Read Docs](https://js-recon.io/docs/docs/modules/run) |
|
|
141
141
|
| `analyze` | Analyzes the code. | [Read Docs](https://js-recon.io/docs/docs/modules/analyze) |
|
|
142
|
+
| `exploit` | Attempts exploitation of known framework CVEs to discover new attack surface. | [Read Docs](https://js-recon.io/docs/docs/modules/exploit) |
|
|
142
143
|
| `report` | Generates a report from the analysis modules. | [Read Docs](https://js-recon.io/docs/docs/modules/report) |
|
|
143
144
|
| `mcp` | AI-powered interactive CLI, one-shot chat, and MCP stdio server. | [Read Docs](https://js-recon.io/docs/docs/modules/mcp) |
|
|
144
145
|
| `fingerprint` | Detects the JavaScript framework used by a target URL (JSON/JSONL output). | [Read Docs](https://js-recon.io/docs/docs/modules/fingerprint) |
|
|
@@ -157,7 +158,7 @@ js-recon --config ./operator.yaml run \
|
|
|
157
158
|
- Map feature analyzes the JS files and outputs it to a JSON file. An interactive mode can be then used to analyze it
|
|
158
159
|
- Reconstruct HTTP requests that the app makes to the server, and output them to the OpenAPI spec
|
|
159
160
|
- Run analyze to find potential issues in JS code and the HTTP requests the app makes
|
|
160
|
-
- Generate a report from the analyze module
|
|
161
|
+
- Generate a report from the analyze module (optional active endpoint probing via `sj`/swagger-jacker integration using `--sj`)
|
|
161
162
|
|
|
162
163
|
## Example Scenario
|
|
163
164
|
|
package/SECURITY.md
CHANGED
|
@@ -17,7 +17,7 @@ Include in your report:
|
|
|
17
17
|
- Affected version(s)
|
|
18
18
|
- Any suggested mitigations, if known
|
|
19
19
|
|
|
20
|
-
You can expect an acknowledgement within **72 hours
|
|
20
|
+
You can expect an acknowledgement within **72 hours**, and no later than **14 days** from the initial report. If a vulnerability is confirmed, a fix will be prioritized based on severity, with a target of **60 days** to ship a patch for confirmed vulnerabilities affecting a publicly released version.
|
|
21
21
|
|
|
22
22
|
## Scope
|
|
23
23
|
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import chalk from "chalk";
|
|
11
10
|
import parser from "@babel/parser";
|
|
12
11
|
import _traverse from "@babel/traverse";
|
|
13
12
|
import _generator from "@babel/generator";
|
|
@@ -19,6 +18,7 @@ import { resolveFunctionIdentifier } from "../helpers/engineHelpers/resolveFunct
|
|
|
19
18
|
import { findMemberExpressionAssignment } from "../helpers/engineHelpers/findMemberExpressionAssignment.js";
|
|
20
19
|
import { findDirectAssignment } from "../helpers/engineHelpers/findDirectAssignment.js";
|
|
21
20
|
import { computeTaint, sinkConsumesTaint } from "../helpers/engineHelpers/taintFlow.js";
|
|
21
|
+
import { printMsg, MSG } from "../../utility/printMsg.js";
|
|
22
22
|
/**
|
|
23
23
|
* ESQuery-based AST analysis engine for detecting code patterns using custom rules.
|
|
24
24
|
*
|
|
@@ -32,7 +32,7 @@ import { computeTaint, sinkConsumesTaint } from "../helpers/engineHelpers/taintF
|
|
|
32
32
|
*/
|
|
33
33
|
const esqueryEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
34
|
var _a, _b;
|
|
35
|
-
|
|
35
|
+
const findings = [];
|
|
36
36
|
for (const chunk of Object.values(mappedJsonData)) {
|
|
37
37
|
// first of all, load the code in ast
|
|
38
38
|
let ast;
|
|
@@ -46,7 +46,7 @@ const esqueryEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
46
46
|
catch (_c) {
|
|
47
47
|
continue;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
const matchList = {};
|
|
50
50
|
const completedSteps = new Set();
|
|
51
51
|
// Cache taint info per "source step name" so we don't recompute when several
|
|
52
52
|
// sink steps share the same source step.
|
|
@@ -138,6 +138,7 @@ const esqueryEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
138
138
|
}
|
|
139
139
|
else if (step.regexMatch) {
|
|
140
140
|
// Scan all StringLiteral/TemplateLiteral nodes in the chunk for values matching the regex
|
|
141
|
+
// eslint-disable-next-line security/detect-non-literal-regexp -- pattern comes from a loaded rule YAML file — same trust model as the rest of the rule engine, not user/network input
|
|
141
142
|
const pattern = new RegExp(step.regexMatch.pattern);
|
|
142
143
|
const foundNodes = [];
|
|
143
144
|
_traverseDefault(ast, {
|
|
@@ -165,7 +166,7 @@ const esqueryEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
165
166
|
const toMatch = step.checkAssignmentExist.type;
|
|
166
167
|
const memberExpression = step.checkAssignmentExist.memberExpression;
|
|
167
168
|
if (selectedNode && memberExpression) {
|
|
168
|
-
const assignmentNode = findMemberExpressionAssignment(selectedNode, toMatch
|
|
169
|
+
const assignmentNode = findMemberExpressionAssignment(selectedNode, toMatch);
|
|
169
170
|
if (assignmentNode) {
|
|
170
171
|
matchList[step.name] = { node: assignmentNode, scope: ast };
|
|
171
172
|
completedSteps.add(step.name);
|
|
@@ -188,18 +189,18 @@ const esqueryEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
188
189
|
for (const reportNode of nodesToReport) {
|
|
189
190
|
const code = generator(reportNode).code;
|
|
190
191
|
if (rule.severity === "info") {
|
|
191
|
-
|
|
192
|
+
printMsg(MSG.Header, message);
|
|
192
193
|
}
|
|
193
194
|
else if (rule.severity === "low") {
|
|
194
|
-
|
|
195
|
+
printMsg(MSG.Warn, message);
|
|
195
196
|
}
|
|
196
197
|
else if (rule.severity === "medium") {
|
|
197
|
-
|
|
198
|
+
printMsg(MSG.Info, message);
|
|
198
199
|
}
|
|
199
200
|
else if (rule.severity === "high") {
|
|
200
|
-
|
|
201
|
+
printMsg(MSG.Err, message);
|
|
201
202
|
}
|
|
202
|
-
|
|
203
|
+
printMsg(MSG.Plain, highlight(code, {
|
|
203
204
|
language: "javascript",
|
|
204
205
|
ignoreIllegals: true,
|
|
205
206
|
theme: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"astEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/astEngine.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"astEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/astEngine.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,MAAM,MAAM,eAAe,CAAC;AACnC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,MAAM,gBAAgB,GAAG,SAA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;YACP,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAA,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import chalk from "chalk";
|
|
11
10
|
import { cs_mast_init, parseSignature, ParseError } from "@shriyanss/cs-mast";
|
|
11
|
+
import { printMsg, MSG } from "../../utility/printMsg.js";
|
|
12
12
|
/**
|
|
13
13
|
* Walk all AdapterNode descendants post-order and check if any node's
|
|
14
14
|
* computedHash equals the target hex hash. The _signatureMap built by
|
|
@@ -60,7 +60,7 @@ const csMastSEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
60
60
|
const { signature } = step.csMastS;
|
|
61
61
|
const parsed = parseSignature(signature);
|
|
62
62
|
if (!parsed) {
|
|
63
|
-
|
|
63
|
+
printMsg(MSG.Warn, `[!] cs-mast-s step "${step.name}" in rule "${rule.id}" has an invalid signature — skipping`);
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
const config = {
|
|
@@ -99,16 +99,16 @@ const csMastSEngine = (rule, mappedJsonData) => __awaiter(void 0, void 0, void 0
|
|
|
99
99
|
const matchedSigs = rule.steps.filter((s) => s.csMastS).map((s) => s.csMastS.signature);
|
|
100
100
|
const message = `[+] "${rule.name}" found in chunk ${chunk.id}`;
|
|
101
101
|
if (rule.severity === "info") {
|
|
102
|
-
|
|
102
|
+
printMsg(MSG.Header, message);
|
|
103
103
|
}
|
|
104
104
|
else if (rule.severity === "low") {
|
|
105
|
-
|
|
105
|
+
printMsg(MSG.Warn, message);
|
|
106
106
|
}
|
|
107
107
|
else if (rule.severity === "medium") {
|
|
108
|
-
|
|
108
|
+
printMsg(MSG.Info, message);
|
|
109
109
|
}
|
|
110
110
|
else if (rule.severity === "high") {
|
|
111
|
-
|
|
111
|
+
printMsg(MSG.Err, message);
|
|
112
112
|
}
|
|
113
113
|
findings.push({
|
|
114
114
|
ruleId: rule.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csMastSEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/csMastSEngine.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"csMastSEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/csMastSEngine.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAK9E,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAE1D;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAC,IAAiB,EAAE,aAAqB;;IAC9D,IAAI,IAAI,CAAC,YAAY,KAAK,aAAa;QAAE,OAAO,IAAI,CAAC;IACrD,KAAK,MAAM,KAAK,IAAI,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE,EAAE,CAAC;QACtC,IAAI,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC;YAAE,OAAO,IAAI,CAAC;IAC5D,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GAAG,CAAO,IAAU,EAAE,cAAsB,EAA2B,EAAE;IACxF,MAAM,QAAQ,GAAmB,EAAE,CAAC;IAEpC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;QAChD,2EAA2E;QAC3E,6CAA6C;QAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,EAA2C,CAAC;QAErE,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;QAEzC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YA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,IAAI,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBACpC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAChC,CAAC;iBAAM,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;gBAClC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;YAC/B,CAAC;YAED,QAAQ,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,eAAe,EAAE,IAAI,CAAC,WAAW;gBACjC,UAAU,EAAE,IAAI,CAAC,MAAM;gBACvB,QAAQ,EAAE,IAAI,CAAC,IAAI;gBACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,OAAO;gBACP,eAAe,EAAE,aAAa,KAAK,CAAC,EAAE,6BAA6B,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAC9F,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAA,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -25,7 +25,7 @@ import csMastSEngine from "./csMastSEngine.js";
|
|
|
25
25
|
*/
|
|
26
26
|
export const engine = (rule, mappedJsonData, openapiData, tech) => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
27
|
// first of all check what is rule type, and then check if the data for that is available or is undefined
|
|
28
|
-
|
|
28
|
+
const findings = [];
|
|
29
29
|
if (rule.type === "request") {
|
|
30
30
|
if (!openapiData) {
|
|
31
31
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/analyze/engine/index.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,SAAS,MAAM,gBAAg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
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import
|
|
10
|
+
import { printMsg, MSG } from "../../utility/printMsg.js";
|
|
11
11
|
/**
|
|
12
12
|
* Request-based analysis engine for analyzing OpenAPI specifications against rules.
|
|
13
13
|
*
|
|
@@ -21,7 +21,7 @@ import chalk from "chalk";
|
|
|
21
21
|
*/
|
|
22
22
|
const engine = (rule, openapiData) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
var _a;
|
|
24
|
-
|
|
24
|
+
const findings = [];
|
|
25
25
|
for (const path in openapiData.paths) {
|
|
26
26
|
const methods = openapiData.paths[path];
|
|
27
27
|
for (const method in methods) {
|
|
@@ -69,16 +69,16 @@ const engine = (rule, openapiData) => __awaiter(void 0, void 0, void 0, function
|
|
|
69
69
|
// get the severity of the rule
|
|
70
70
|
const message = `[+] "${rule.name}" found in ${path} [${method.toUpperCase()}]`;
|
|
71
71
|
if (rule.severity === "info") {
|
|
72
|
-
|
|
72
|
+
printMsg(MSG.Header, message);
|
|
73
73
|
}
|
|
74
74
|
else if (rule.severity === "low") {
|
|
75
|
-
|
|
75
|
+
printMsg(MSG.Warn, message);
|
|
76
76
|
}
|
|
77
77
|
else if (rule.severity === "medium") {
|
|
78
|
-
|
|
78
|
+
printMsg(MSG.Info, message);
|
|
79
79
|
}
|
|
80
80
|
else if (rule.severity === "high") {
|
|
81
|
-
|
|
81
|
+
printMsg(MSG.Err, message);
|
|
82
82
|
}
|
|
83
83
|
findings.push({
|
|
84
84
|
ruleId: rule.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/requestEngine.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"requestEngine.js","sourceRoot":"","sources":["../../../src/analyze/engine/requestEngine.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,QA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