Skip to content

Fix misleading validation-failure log message in AddPlayer/CreateNewA… - #917

Merged
SeanDuggan merged 1 commit into
OWASP:devfrom
shishir-cyber:fix/misleading-js-bypass-log-message
Sep 2, 2026
Merged

SeanDuggan merged 1 commit into
OWASP:devfrom
shishir-cyber:fix/misleading-js-bypass-log-message

Conversation

@shishir-cyber

Copy link
Copy Markdown
Contributor

Closes #860

Problem

AddPlayer.java and CreateNewAdmin.java logged log.error("JavaScript validation bypassed") whenever Validate.isValidUser() rejected input, even for the routine case of e.g. a too-short password. This wrongly implied a malicious client-side bypass and gave no detail on which constraint failed.

Fix

  • Reworded the log to describe an accurate server-side validation failure, including the lengths of the offending fields (never the
    actual values) so operators can see which constraint was violated.
  • Downgraded the log level from ERROR to WARN.
  • Applied the same fix to CreateNewAdmin.java, which had the identical pattern.
  • User-facing response message is unchanged.

Verification

  • mvn spotless:check - passes
  • mvn clean install -Pdocker -DskipTests - compiles cleanly
  • No existing unit or integration tests reference these servlets

…dmin

Replace the inaccurate "JavaScript validation bypassed" ERROR log with
an accurate WARN message describing a server-side validation failure.

- Log the length of the offending username/password/address fields
  instead of asserting a JS bypass, so operators can tell which
  constraint (username 3-32 chars, password 8-512 chars, address
  <=128 chars) was violated.
- Never log the actual field values (especially the password).
- Downgrade log level from ERROR to WARN, since this is a routine
  input-validation rejection, not a tamper signal.
- Apply the same fix to CreateNewAdmin.java, which had the identical
  issue.
- User-facing response message is unchanged.

Fixes OWASP#860
@SeanDuggan SeanDuggan self-assigned this Sep 2, 2026
@SeanDuggan SeanDuggan added Enhancement Platform java Pull requests that update java code labels Sep 2, 2026
@SeanDuggan
SeanDuggan self-requested a review September 2, 2026 20:50

@SeanDuggan SeanDuggan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @shishir-cyber. Let us know if you find any other logging events we can improve on.

@SeanDuggan
SeanDuggan merged commit c5d9130 into OWASP:dev Sep 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement java Pull requests that update java code Platform

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Improve misleading "JavaScript validation bypassed" log message in AddPlayer

2 participants