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

[Bug]: Password fields render as regular text fields #19389

Closed
d-ellis opened this issue Jan 29, 2025 · 0 comments · Fixed by #19390
Closed

[Bug]: Password fields render as regular text fields #19389

d-ellis opened this issue Jan 29, 2025 · 0 comments · Fixed by #19390

Comments

@d-ellis
Copy link

d-ellis commented Jan 29, 2025

Attach (recommended) or Link to PDF file

password-bug.pdf

Web browser and its version

Firefox 134.0.2 (64-bit)

Operating system and its version

Windows 10 Pro 22H2 19045.5247

PDF.js version

Whatever version is currently in the online demo

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Have a PDF that includes a password field.
  2. Open it in Firefox, the online demo, or using the Chrome PDF Viewer extension.
    https://chromewebstore.google.com/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm
  3. The PDF renders the password field as if it were a normal text field.
    Image

Also, when interrogating the PDF with pdfjs-dist v3.11.174, the field is given the type "text" rather than "password".
(I know that's an outdated version, but I just can't figure out how to make a newer version work, and it illustrates that it's likely not a rendering problem, but an underlying problem when parsing the PDF)

What is the expected behavior?

Password fields should be rendered as such, and the characters should be obscured (with asterisks or otherwise), like what happens in the following:

Adobe Acrobat:
Image
Chrome:
Image
Edge (quite probably the same renderer as Chrome):
Image

What went wrong?

As mentioned above, the PDF renders the password field as if it were a normal text field.

Link to a viewer

No response

Additional context

Admittedly, the usefulness of a password field in a PDF is somewhat lost on me, however it is a feature that should be supported because it's a bit of a problem if a value should be obscured and you completely expose it.
Yes the value would still be visible to anyone with basic JS knowledge that inspects the viewer, but at least it wouldn't be visible to someone looking over your shoulder when you open the PDF.

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

Successfully merging a pull request may close this issue.

1 participant