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

Document.save() owner_pw & user_pw has buffer overflow bug. #2086

Closed
lys0829 opened this issue Nov 27, 2022 · 2 comments
Closed

Document.save() owner_pw & user_pw has buffer overflow bug. #2086

lys0829 opened this issue Nov 27, 2022 · 2 comments
Labels

Comments

@lys0829
Copy link

lys0829 commented Nov 27, 2022

Please provide all mandatory information!

Describe the bug (mandatory)

owner_pw & user_pw arguments in Document.save()has buffer overflow bug. May cause program crash and arbitrary code execution.

To Reproduce (mandatory)

PoC:

import fitz

pdf = fitz.Document()
pdf.new_page()
pdf.save(1, owner_pw="a"*1000)

Your configuration (mandatory)

FROM ubuntu:20.04
MAINTAINER Lys

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -yq python3.8=3.8.10-0ubuntu1~20.04.5 python3-pip

RUN pip3 install PyMuPDF==1.20.2
@JorjMcKie
Copy link
Collaborator

Thanks for the report.
There exists a limitation to 40 characters. We will document this and include a respective check.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in PyMuPDF-1.21.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants