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

Magic byte blacklist for NFO uploads #78

Open
sagamusix opened this issue Nov 8, 2017 · 3 comments
Open

Magic byte blacklist for NFO uploads #78

sagamusix opened this issue Nov 8, 2017 · 3 comments

Comments

@sagamusix
Copy link
Contributor

It happens frequently that screenshots are uploaded as NFOs instead. With a user mistake happening that often, it is obvious that there is a UI problem, but that's not the point of this issue. As an easy countermeasure, the uploaded NFO could be scanned for a few selected magic bytes of commonly used graphics formats and then reject the upload. Examples: "GIF", "\xFF\xD8\xFF" (JPEG), "\x89PNG".

@Gargaj
Copy link
Contributor

Gargaj commented Nov 8, 2017

Is it really that frequent though? Like, once a year?

@sagamusix
Copy link
Contributor Author

Certainly a bit more than just once a year, but probably not more than once a month or so. Latest example: https://www.pouet.net/prod_nfo.php?which=72222

@Gargaj
Copy link
Contributor

Gargaj commented Mar 15, 2018

I'm still not convinced that blocking certain strings is a good idea, just because an NFO contains "GIF89" doesn't mean it's invalid; that being said a warning box saying "are you sure this is the .nfo" can potentially work. I'd have to look into JS to see about local file reading though. (I've done it before but I try not to remember a lot of it.)

What I fear is that like in most cases, an outright block will hit false positives, and a warning will not deter people enough.

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

2 participants