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

Add GIF fuzzer #14

Merged
merged 2 commits into from Nov 10, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -147,5 +147,6 @@ any unnecessary work is done.
* [js-yaml: Crash/TypeError](https://github.com/nodeca/js-yaml/issues/524)
* [js-yaml: Crash/TypeError](https://github.com/nodeca/js-yaml/issues/525)
* [asciidoctor: Hang/DoS](https://github.com/asciidoctor/asciidoctor/issues/3472)
* [deanm/omggif: Crash/TypeError](https://github.com/deanm/omggif/issues/41)

**Feel free to add bugs that you found with jsfuzz to this list via pull-request**
@@ -0,0 +1,24 @@
const omggif = require('omggif')

async function fuzz (bytes) {
try {
omggif.GifReader(bytes)
} catch (error) {
if (!acceptable(error)) throw error
}
}

function acceptable (error) {
return !!expected
.find(message => error.message.startsWith(message))
}

const expected = [
'Invalid GIF 87a/89a header',
'Unknown gif block',
'Invalid block size',
'Invalid graphics extension block',
'Unknown graphic control label'
]

exports.fuzz = fuzz

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,9 @@
{
"name": "gif-fuzz",
"version": "1.0.0",
"main": "fuzz.js",
"license": "ISC",
"dependencies": {
"omggif": "^1.0.10"
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.