Skip to content

New rule: forms that silently lose submissions (unnamed fields, dead or staging actions) #707

Closed

Description

@nc9

Problem

A contact or signup form can look perfect and still lose every submission. Two causes are common and invisible from the outside:

  • A field with no name. Browsers only submit controls that have a name. An <input id="email"> without name="email" is shown, filled in and then silently dropped from the request. It usually comes from a copy-pasted field or a refactor that renamed name to id, and the site owner finds out weeks later when someone asks why nobody replies.
  • An action that goes nowhere. The form posts to a URL that now returns 404 (an old /contact.php, a deleted Formspree form), to a staging or preview host that shipped by accident (https://staging.example.com/api/lead, http://localhost:3000/subscribe), or to mailto:, which only opens the visitor's mail client, if they have one, and loses the submission otherwise.

squirrel does not check either. security/form-https covers forms that submit over plain http: (including cross-host actions and formaction on submit buttons), and the accessibility rules check that fields have labels, but nothing checks that a field is submitted or that the action URL answers. content/dev-leakage finds staging and localhost hosts in href and src, but does not read form action.

Proposal

New rule reliability/broken-forms in the Reliability category (#703). It reports three things.

Fields that are never submitted

  • Warn: a form with a real action URL (not empty, # or javascript:) contains an input, select or textarea without a name. If a script does not take over, that field never reaches the server, and a field missing beside named ones is the classic copy-paste bug.
  • Info: the same in a form with no real action. Those are usually handled by a script that reads fields by id or from component state, so they are reported as unconfirmed, not broken.
  • Not reported: type="submit|button|reset|image", disabled controls, controls inside <template>, and controls whose form attribute points at a different form. A control outside any <form> that names one with form="id" is judged as part of that form.

Actions that go nowhere

  • Error: a first-party action URL answers 404 or 410.
  • Warn: the action points at a staging, preview, development or localhost host (the same host classification content/dev-leakage uses), or uses mailto:.
  • Warn: a first-party action URL answers 5xx, or fails at the network level (DNS, TLS, timeout).
  • Not broken: 405 or 501 (the endpoint exists but does not accept that probe method), 401 and 403, 429, 503 with Retry-After, and WAF challenges. The last three are reported as unverified (info), as the link checks do.

How the action is checked, without ever submitting the form (a formaction on a submit button is checked the same way as the form's action):

  • A same-origin action URL that the crawl already fetched uses that status. No new request.
  • Any other same-origin action is probed only when the run's probe level is active or aggressive, with HEAD, falling back to GET. Never POST. Under passive probing it is left unchecked and the result says so.
  • A third-party action (Formspree, HubSpot, Mailchimp) is checked only when external link checking is on, through the same checker and the same rules for unverified statuses.

Notes

  • Cost: the field and host checks read the DOM a page rule already has. Action checks reuse crawl statuses first, then send at most one probe per distinct action URL, inside the shared probe budget.
  • False-positive risk: the unnamed-field check is where it lives. Forms built with React, Vue and friends often read values from state, not from the submitted body. Warning only when the form has a real action keeps the warning for forms that post their fields to a server, and the finding says a script may be reading the field. A GET probe of a POST handler can return 5xx on a badly written endpoint, which is why 5xx only warns.
  • Insecure submission stays with security/form-https and is not reported again here.

Acceptance Criteria

  • Fixture: <form action="/contact" method="post"> with <input name="name"> and <input id="email" type="email"> produces a warning naming the unnamed email field and the form
  • Fixture: the same form with every field named produces no finding
  • Fixture: a form with no action (or action="#") and an unnamed field produces an info result, not a warning
  • Fixture: unnamed type="submit", type="button", disabled controls, and a control with form="other" are not reported against the form they sit in; a control outside the form with form="contact" and no name is reported against #contact
  • Fixture: a form whose same-origin action was crawled and answered 404 produces an error, with no extra request sent
  • Fixture: an uncrawled same-origin action that answers 405 to HEAD and GET is not reported as broken; one that answers 404 is
  • No probe ever uses POST, and under passive probing no request is sent for an uncrawled action and the result says the action was not checked
  • Fixture: action="https://staging.example.com/lead" on example.com, action="http://localhost:3000/subscribe" and action="mailto:[email protected]" each produce a warning
  • An action answering 429, 503 with Retry-After, or a WAF challenge is reported as unverified (info), never as broken
  • A third-party action is only requested when external link checking is on
  • An http: action on an HTTPS page is reported by security/form-https only, not by this rule
  • The rule has a docs page under docs/rules/reliability/

Activity

  1. added
    enhancement
    size: M
    rules
    on Oct 12, 2026
  2. nc9 commented on Oct 13, 2026

    @nc9
    ContributorAuthor

    Note: commit 7d772c1 (pub#717, security.txt and version-disclosure) references this issue by mistake in its subject; it belongs to #713 (already closed). This issue (broken-forms) is still open and is tracked by the replacement PR for #719.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementrulessize: M

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions