Repository navigation
Document what --include-module-folders does - #463
Draft
David Larsen (dc-larsen) wants to merge 6 commits into
Draft
David Larsen (dc-larsen) wants to merge 6 commits into
David Larsen (dc-larsen) wants to merge 6 commits into
Conversation
The help text said "Enabling including module folders like node_modules", which doesn't say what a scan gains. The flag removes node_modules, bower_components and jspm_packages from the directories manifest discovery skips. Every package.json under them is then uploaded as its own project, and Socket resolves the dependencies each one declares, devDependencies included. The installed packages themselves are never recorded, so the flag can add hundreds of packages a project never installs and still misses a package that a postinstall script put in node_modules without a lockfile entry. Say that in the help text and the CLI reference, and add a troubleshooting entry for packages installed outside the lockfile: a CycloneDX SBOM of the installed tree saved in the scan root is picked up by manifest discovery and uploaded with the other manifests. No behavior change. Bumps the version to 2.13.1 for the version check.
David Larsen (dc-larsen)
temporarily deployed
to
socket-firewall
November 20, 2026 20:34 — with
GitHub Actions
Inactive
--include-module-folders does
The flag adds every supported manifest under node_modules, bower_components and jspm_packages, at any depth, not only each package's top-level package.json. Those files are added to the same scan; no separate project is created. Say that in the reference, troubleshooting entry and changelog. Cut the help text to two sentences and point to the troubleshooting section on GitHub, since pip installs don't include the docs folder.
David Larsen (dc-larsen)
deployed
to
socket-firewall
November 20, 2026 22:08 — with
GitHub Actions
Active
This was referenced Nov 20, 2026
…olders-behavior # Conflicts: # CHANGELOG.md
This was referenced Nov 20, 2026
2.13.2 was released from main, so this change needs the next patch version.
David Larsen (dc-larsen)
deployed
to
socket-firewall
November 20, 2026 23:11 — with
GitHub Actions
Active
This branch was successfully deployed
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.
Docs only. The
--include-module-foldershelp text is "Enabling including module folders like node_modules", which reads as "scan what's installed". It doesn't do that, and turning it on can add hundreds of packages to a scan while still missing the package a user was looking for.What the flag does, from the source:
socketcli.pyremovesmodule_folder_dirs(node_modules,bower_components,jspm_packages) fromcore.config.excluded_dirsbefore anyfind_filescall. Same effect as--include-dirs node_modules,bower_components,jspm_packages.find_filesthen descends into those folders, at any depth, and keeps every file matching a supported manifest pattern. In practice that is mostly each package'spackage.json(nestednode_modulesand scoped packages included), plus any other manifest or lockfile a package ships, such as arequirements.txtoryarn.lock. The hiddennode_modules/.package-lock.jsondoesn't match thepackage-lock.jsonpattern, so it is not picked up.devDependenciesincluded. The installed package's own name and version is not recorded as a dependency.--reach, the samefind_filesresult feeds the manifest upload for reachability, so the extra manifests go there too. The flag passes nothing to the reachability engine itself.vendor,.venvand the other default exclusions are not affected;--include-dirscovers those.Checked on 2.13.0 against a small npm project whose dependency's
postinstallinstalls an extra package intonode_modules: with the flag, the scan gained 504 packages from the installed packages'devDependencies(15 with CVE alerts) and still didn't report the postinstalled package. A CycloneDX SBOM generated from the installed tree (@cyclonedx/cyclonedx-npm7.0.1) and saved asinstalled.cdx.jsonin the scan root was uploaded with the lockfile, and the package showed up with its alerts.Changes:
--include-module-foldershelp text (now two sentences plus a link to the troubleshooting section on GitHub, since pip installs don't shipdocs/) and the CLI reference row say what is uploaded and what isn't.cdxpatterns (bom.json,*.cdx.json,*.cyclonedx.json, and.xml), so no flag is needed.mainon 2026-11-20, so this branch mergesmainatv2.13.2and bumps to2.13.3inpyproject.toml,socketsecurity/__init__.pyanduv.lock, with its CHANGELOG entries under a new## 2.13.3heading. List every existing advisory under--strict-blocking#459, Scan reopened pull requests instead of passing them unscanned #460, Fail with exit3when a scan comparison returns no artifacts #461, Check existing alerts under--strict-blockingwhen no manifest changed #462, Document what--include-module-foldersdoes #463, Stop failingissue_commentruns that have no ignore command #464 and Link "This package" in PR/MR comments to the package page #465 all make the same bump, so the version files merge cleanly between them, and once one merges the rest ride main's unreleased2.13.3(Version Check accepts a version equal to main's while it is above the latest PyPI release). Merging a second one conflicts only inCHANGELOG.md: keep one## 2.13.3heading and combine the bullets under its subsections (Upgrade notes, Changed, Fixed, Documentation, in that order). There are no code conflicts between them. Ifmainreleases 2.13.3 before this merges, bump to the next patch again.Testing:
uv run pytest -q -o addopts=(1001 passed),ruff check .,uv lock --locked --offline,hatch buildandtwine checkpass.socketcli --helprenders the new text.Public Changelog
Documented what
--include-module-foldersdoes: it adds every supported manifest undernode_modules(andbower_components,jspm_packages), at any depth, to the scan and resolves the dependencies those files declare. It does not list installed packages. The troubleshooting guide covers scanning packages installed outside the lockfile with a CycloneDX SBOM.