Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License expressions not parsed correctly causing incorrect license determination (silently ignoring potentially problematic licenses) #274

Open
rafalsatl opened this issue Sep 18, 2024 · 0 comments

Comments

@rafalsatl
Copy link

For license strings containing logical operators as defined for SPDX (or similar to them):
https://spdx.github.io/spdx-spec/v2-draft/SPDX-license-expressions/

License checker currently produces incorrect and dangerous results during the flatten -> license calls:
Input:
name = "simpler-sidebar"
version = "1.4.5"
license = "(MIT and GPL-2.0)"

Output:
licenses = "MIT*"

This is because of this "sub - string" check:

var MIT = /\bMIT\b/;
...
    } else if (MIT.test(str)) {
        return 'MIT*';

Example of affected package.json files:
https://github.com/jqPlot/jqPlot/blob/1.0.9/package.json#L36
https://github.com/gitter-badger/simpler-sidebar/blob/v1.4.5/package.json#L11
https://github.com/maranomynet/formatchange/blob/v2.3.1/package.json#L28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant