Skip to content

Target creation failure drops keyboard focus and does not announce the error #3710

Closed

Description

@romanlutz

Describe the bug

On target creation failure, focus falls to BODY and assistive technology is not notified of the visible error. The invalid field is not marked invalid.

Steps/Code to Reproduce

Open Registry > Targets > New Target, select HTTPTarget, enter not an HTTP request in Http Request, focus Create Target and press Space. Inspect document.activeElement and the error's accessibility attributes.

Expected Results

Keep focus on the submit control or move it to an accessible error summary/invalid field, and announce the error using an alert/live region.

Actual Results

Focus is BODY. Error has role=group, no aria-live/live ancestor, and no focusable summary; Http Request lacks aria-invalid. The only populated polite live region describes the selected target, not the failure.

Verified source reference: CreateTargetDialog.

Proposed fix/regression: focus and announce the error and associate it with the field; test keyboard submission and accessibility semantics after a failed create.

Screenshots

The screenshot is retained as a local recovery artifact, not attached here.

Versions

Tested commit d3446e0, PyRIT 1.2.0.dev0, offline local-backend/browser scope. Evidence: files/evidence/round2/target-error-focus.json and target-error-accessibility.json; local paths are not attachments.

Activity

  1. romanlutz commented on Nov 5, 2026

    @romanlutz
    ContributorAuthor

    Darrell Chee (@darrellchee) there's already a PR so I'll close yours.

  2. darrellchee commented on Nov 7, 2026

    @darrellchee

    Roman Lutz (@romanlutz) Okay, understood, thanks for letting me know. I've actually made a short explainer video of my solution in case it's useful as context. I'm more than willing to keep contributing to PyRIT. Is there a particular issue you'd like tackled?

    Video:

    focus-off-the-page-fixing-pyrit-3710_169.mp4
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions