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

Cannot read properties of null (reading 'type') #1454

Open
manunio opened this issue Nov 20, 2023 · 0 comments
Open

Cannot read properties of null (reading 'type') #1454

manunio opened this issue Nov 20, 2023 · 0 comments

Comments

@manunio
Copy link

manunio commented Nov 20, 2023

Description

While Fuzzing locally using jazzer.js parser.parse() threw TypeError: Cannot read properties of null (reading 'type')

Steps to reproduce

 cat test.js
const parser = require('./nunjucks/src/parser')
parser.parse('_•0]{{{{')
 node test.js
/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1162
      const type = this.peekToken().type;
                                   ^

TypeError: Cannot read properties of null (reading 'type')
    at Parser.parseAggregate (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1162:36)
    at Parser.parsePrimary (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1054:19)
    at Parser.parseAggregate (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1180:26)
    at Parser.parsePrimary (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1054:19)
    at Parser.parseUnary (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:1007:19)
    at Parser.parsePow (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:983:21)
    at Parser.parseMod (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:971:21)
    at Parser.parseFloorDiv (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:959:21)
    at Parser.parseDiv (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:947:21)
    at Parser.parseMul (/home/maxx/dev/security/oss-fuzz-projects/nunjucks/nunjucks/src/parser.js:935:21)

Node.js v21.1.0
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