Skip to content

various programs with unmatching curlies and parens do not cause SyntaxError to be thrown #5

Open

Description

@michaelficarra
> require('syntax-error')('})({')
undefined

Activity

  1. ArtskydJ commented on Jan 27, 2016

    @ArtskydJ

    Technically, node does allow some weird syntax:

    C:\Users\Michael\Github\JS_Source>cat unmatching.js
    }, function (){
    
    C:\Users\Michael\Github\JS_Source>node unmatching.js
    

    Although the specific case you mentioned does throw an error for another reason.

    Edit in case it's unclear, I do feel like this is an issue, even though node acts funny.

  2. m1el commented on Jul 6, 2018

    @m1el

    There's also invalid result when providing a crafted program:

    let syntaxError = require('syntax-error');
    let err = syntaxError('}); function undefined() { return 42; }; ({');
    console.log(err(), err.toString());

    42 'function undefined() { return 42; }'

    As far as I know, on its own it doesn't allow arbitrary code execution, but I might be missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions