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

coffeescript mapping invalid #7

Open
felickz opened this issue Nov 7, 2024 · 1 comment
Open

coffeescript mapping invalid #7

felickz opened this issue Nov 7, 2024 · 1 comment

Comments

@felickz
Copy link

felickz commented Nov 7, 2024

Test repo:https://github.com/vulna-felickz/coffeescript-test

To transpile to js and generate map:

npm install -g coffeescript
coffee --compile --map *.coffee

Error

python3 remap_sarif.py javascript.sarif "." --output after-javascript.sarif

Outputs

Image

When uploading to code scanning - cannot generate fingerprint as it maps to invalid line 0

    {
        "path": [
        "runs",
        0,
        "results",
        0,
        "locations",
        0,
        "physicalLocation",
        "region",
        "startLine"
        ],
        "property": "instance.runs[0].results[0].locations[0].physicalLocation.region.startLine",
        "message": "must be greater than or equal to 1",
        "schema": {
        "description": "The line number of the first character in the region.",
        "type": "integer",
        "minimum": 1
        },
        "instance": 0,
        "name": "minimum",
        "argument": 1,
        "stack": "instance.runs[0].results[0].locations[0].physicalLocation.region.startLine must be greater than or equal to 1"
    }

Though - the source-map-visualization tool appears to map it OK

Image

JS-Map.zip

@felickz
Copy link
Author

felickz commented Nov 7, 2024

I plugged in JS source-map from mozilla and it appears to properly map -- not sure if there is a better python lib here?:

Image

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