Severity
Medium
Short Description
Package has dependencies with an invalid semantic version. This could be a sign of beta, low quality, or unmaintained dependencies.
Suggestion
Switch to a version of the dependency with valid semver or override the dependency version if it is determined to be problematic.
Semantic versioning (SemVer) is critical for managing dependencies across different versions of a package. A "bad" SemVer dependency may not adhere to proper versioning standards, leading to potential incompatibility issues with other libraries or breaking changes that weren't expected.
There are numerous risks when using a dependency with an invalid semantic version:
These risks highlight the importance of adhering to proper semantic versioning practices to maintain stability, security, and predictability within software projects.
Bad Dependency Semver is a medium-severity alert, and the default security policy has it set to Warn. Depending on the criticality of your project, you may want to remove or lock the dependency to a safe version to prevent unexpected or incompatible changes from disrupting your application.
Here's an example of a package flagged for having a dependency with invalid semantic versioning.

The specific dependency listed in package.json is linked in the alert:

Socket's Bad Dependency Semver alert detects packages that have an invalid semantic version, according to node-semver, the semver parser for node that npm uses. This alert is only applicable to the npm ecosystem.