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

Mismatched MIME type detected for password protected docx, pttx, xlsx #474

Open
EranOfer opened this issue Jan 30, 2024 · 2 comments
Open

Comments

@EranOfer
Copy link

Attach the file for which the detection is inaccurate

protected_xlsx.xlsx

protected_docx.docx

Expected MIME type

xlsx , docx, pptx

Returned MIME type

application/vnd.ms-powerpoint
.ppt

Version of the library you are using

github.com/gabriel-vasile/mimetype v1.4.3

Output of go version

go version go1.20.6 darwin/amd64

Additional context

I notice there is a problem with detecting lock xlsx , docx, pptx they are detected as ppt

@gabriel-vasile
Copy link
Owner

@EranOfer, I'm checking this.

One thing about the attached test files: the extensions are .docx and .xlsx, but those are actually .doc and .xls files.

@tamir-laminar
Copy link

tamir-laminar commented Nov 24, 2024

@gabriel-vasile When the content of docx, xlsx, pptx is been protected, the content is been encrypted, and the file is no longer a valid zip file (yes, it looks like a .doc but it is still a .docx if you decrypt it)

Still, if we use the ubuntu file command we'll get the following:

~❯ file --mime-type /protected_docx.docx
/protected_docx.docx: application/encrypted

Also, for another docx file I have, that is encrypted using a MIP label, we'll get:

~❯ file --mime-type /Document.docx
/Document.docx: application/vnd.ms-office

But as he said, this library return application/vnd.ms-powerpoint which is not the case.

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

3 participants