Skip to content

Stop browsers autofilling Access List authorization fields - #5892

Open
askalf wants to merge 7 commits into
NginxProxyManager:developfrom
sprayberry-code:fix/access-list-auth-autofill
Open

askalf wants to merge 7 commits into
NginxProxyManager:developfrom
sprayberry-code:fix/access-list-auth-autofill

Conversation

@askalf

@askalf askalf commented Sep 25, 2026 •

Copy link
Copy Markdown

Summary

  • The Access List modal's Authorization tab is a bootstrap tab-pane that is always mounted (hidden by CSS, never unmounted), so its username/password inputs are live in the DOM while the user is on the Details or Access Rules tab.
  • Those two inputs carried autoComplete="off", which Chrome and Firefox deliberately ignore for credential fields, and carried no name attribute at all, so password-manager heuristics had nothing to exclude them by.
  • A password manager therefore fills the admin's own NPM login into the hidden tab. handleChange writes it into Formik, and AccessListModal's onSubmit sends it as payload.items, silently enabling HTTP Basic Auth on every proxy host using that access list.
  • Fix: autoComplete="new-password" on both inputs (the value the repo's own ChangePasswordModal already uses for exactly this purpose) plus per-row non-credential name attributes. One file, four lines changed.

Tests

BasicAuthFields.test.tsx checks the inputs' name and autocomplete attributes. It fails on develop and passes with the fix (npx vitest run src/components/Form/BasicAuthFields.test.tsx).

Why

A password manager fills the admin login into the hidden Authorization tab of the Access List modal, and saving the list then turns on HTTP Basic Auth for every proxy host using it (#5867). The inputs need an autocomplete value browsers honour for credential fields and non-credential names.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change
  • Documentation update

AI Usage

  • AI was used to write this
  • AI was used to review this

AI assistance: this bug was found and the fix and tests were drafted with AI tooling in my workflow; the tests and checks above were run as described. I'm responsible for the change and will handle review feedback.

The Authorization tab of the Access List modal stays mounted while the
Details and Access Rules tabs are shown, so password managers fill the
username and password inputs even though the user never opens that tab.
Saving then silently enables basic auth on the access list with the
admin's own NPM credentials.

Browsers ignore autocomplete="off" on credential inputs. Use
autocomplete="new-password" on both, as ChangePasswordModal already
does, and give the inputs non-credential names so heuristic matching
has nothing to latch onto.

Fixes NginxProxyManager#5867
The autofill regression test only rendered the component once per case, so
the name and autocomplete attributes were unpinned on rows created by the
Add button and on rows renumbered after a remove. Split the multi-assert
cases so each arm is shown to discriminate on its own, add the empty
form-field-name boundary, and add a control asserting the submitted items
payload is unchanged by the new DOM name attributes.
Share one render helper, table the attribute cases and use short behaviour
names, keeping every input that was covered before.
handleRemove pushes a fresh blank item when the list would become empty, a second path onto the row template that the add and renumber cases do not reach.
Fold the duplicated name and autocomplete cases into two tables, drop the
value and placeholder cases that do not depend on the changed attributes, and
make the submission case fire a submit and assert the values the handler
receives.
The row add, remove and submit cases covered behaviour this change does not touch.
@nginxproxymanagerci

Copy link
Copy Markdown

Docker Image for build 2 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5892

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

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 this pull request may close these issues.

1 participant