P3 Weak Password Policy Enforcement Through Direct API Requests
The application may enforce password complexity only on the client side, allowing an authenticated user to bypass restrictions by sending a direct API request with a weak password. This could let users set easily guessable passwords, reducing authentication security.
Published on medium.com
The application’s password-change functionality may enforce password complexity requirements through client-side validation without consistently enforcing the same requirements on the backend.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
The target here is the account management area of a web application, specifically the password change functionality. Normally this feature lets an authenticated user replace their current password with a new one. The application displays a password policy to the user, for example a minimum length plus uppercase, lowercase, numeric and special characters, and the interface refuses to submit a password that does not meet those rules.
The report classifies the weakness as improper input validation and weak authentication controls, mapping it to CWE-521 (Weak Password Requirements), CWE-20 (Improper Input Validation) and CWE-602 (Client-Side Enforcement of Server-Side Security), and to OWASP A07 (Authentication Failures). The stated severity is P3 Medium, with a network attack vector, low privileges required and no user interaction. The report itself marks the status as illustrative and requiring validation.
Setup
To follow the steps you need:
- An authorised test account.
- Burp Suite.
- Access to the account password-change functionality.
The affected component is described as the Account Management / Password Change API, using POST, PUT or PATCH, with authentication required. The report does not name a specific host, product or version; the host in the request is a placeholder.
Finding it
The researcher's observation is that the password complexity requirements appear to be enforced through client-side validation, without the same requirements being consistently enforced on the backend. The frontend may require a minimum length, uppercase and lowercase characters, numbers and special characters, but if the backend does not independently validate these requirements it may accept passwords that do not satisfy the documented policy.
The reason this matters is that a user could then set an easily guessable password, which reduces the effectiveness of the application's authentication controls. The interface may prohibit the operation, but the API behind it may not.
Exploitation
Step 1: Access password settings
Log in using a controlled test account and navigate to the password-change page.
Step 2: Identify the password policy
Review the password requirements displayed by the application, such as minimum length and character complexity. These are the rules you will later violate deliberately.
Step 3: Intercept the password-change request
Submit a valid password change and intercept the request using Burp Suite. The example request looks like this:
POST /api/v1/account/change-password HTTP/1.1
Host: <application-host>
Authorization: Bearer <TEST_TOKEN>
Content-Type: application/json
{
"current_password": "<CURRENT_TEST_PASSWORD>",
"new_password": "StrongPassword@123"
}
The request targets the password-change endpoint with a bearer token for the test account. The JSON body carries the current password and the new password, and StrongPassword@123 is a value that satisfies the displayed policy, so the request is expected to succeed through the normal flow.
Step 4: Modify the password value
Replace the new password with a value that violates the application's stated policy:
{
"current_password": "<CURRENT_TEST_PASSWORD>",
"new_password": "123"
}
Only the new_password field changes. The value 123 is far below any minimum length and contains no character variety.
Step 5: Forward the modified request
Send the request to the backend and inspect the response. The question to answer is whether the server rejects the password or accepts the modification. A rejection means server-side policy enforcement exists; an acceptance means the client-side check was the only barrier.
Step 6: Verify the result
Using the controlled test account, attempt authentication with the newly configured password. A successful password change using a policy-violating password confirms that backend policy enforcement is missing or inconsistent.
Root cause
The likely root cause is insufficient server-side enforcement of password complexity requirements. The application may rely on frontend validation, or it may fail to apply consistent password-policy rules across all password-management endpoints.
The underlying principle is that security requirements must be enforced by the backend, because client-side validation can be bypassed by anyone who can talk to the API directly. The report does not show the server-side code, so the exact mechanism is inferred rather than demonstrated.
Impact
The report lists the following consequences, all conditional on the backend actually accepting the weak password:
- Weak password adoption: users may be able to configure passwords that are easier to guess or crack.
- Reduced authentication security: weak password requirements can reduce resistance to password guessing and credential-stuffing attacks.
- Inconsistent security controls: the backend may permit operations that the application's interface explicitly prohibits.
- Increased account compromise risk: if weak passwords are accepted, accounts may become more susceptible to password-based attacks.
The scenario involves an authenticated user acting on their own account, with low privileges required and no user interaction.
Fix
The report recommends the following remediation:
- Enforce password requirements on the server side.
- Apply consistent validation across registration, password changes, and password-reset workflows.
- Use a secure password policy aligned with current authentication guidance.
- Screen new passwords against commonly used and compromised password lists.
- Avoid relying exclusively on character-composition rules.
- Provide clear validation errors when password requirements are not satisfied.
- Add automated tests for direct API requests containing invalid passwords.
Variants to test
- Other password-management endpoints. Try the same policy-violating value against registration, password reset and any administrative password-set endpoint. A positive result is the server accepting a password the interface would have refused.
- Different HTTP methods. The affected component is listed as POST, PUT or PATCH. If one method enforces the policy, try the others against the same resource. A positive result is one method accepting what another rejects.
- Boundary values. Submit passwords just below the stated minimum length, or with only one character class, rather than an obviously invalid value like
123. A positive result is acceptance of a value that is close to but outside the documented policy, which is harder to dismiss as a test artefact. - Field manipulation. Change the type or structure of the password field in the JSON body and observe whether validation still runs. A positive result is the server storing or accepting a value that bypasses the composition rules.
Hunting notes
This kind of bug tends to hide wherever a password policy is presented to the user as a set of rules in the interface: registration, password change, password reset and account recovery flows. The signal during recon is a client-side validation message or a disabled submit button tied to password strength; if the rule only exists in the browser, the API behind it is worth probing directly.
To show enough impact, the researcher's approach is to keep the test on a controlled account, demonstrate the policy violation through a direct API request, and then confirm it by authenticating with the newly set password. That last step is what would turn a theoretical validation gap into a demonstrated behaviour: the weak password would not just be accepted in a response, it would actually work for login. The report's own status line, illustrative and requiring validation, is a reminder to reproduce the full chain before reporting it.
What happened, in plain words
A website let people change their account password. On the page where you type the new password, the site showed a list of rules: the password must be long enough, contain capital letters, small letters, numbers and special characters. The page was meant to enforce those rules before sending.
But the page is only one way to talk to the website. Behind the page there is a program that actually stores the new password, and that program can be contacted directly, without the page. The researcher's idea was simple: skip the page, send the request yourself, and see whether the program behind it also checks the rules. If it does not, you may be able to set a password like 123, which the page's rules would not allow.
This kind of weakness is called a password policy enforcement bypass. A "password policy" is the set of rules about what a password must look like. "Enforcement" means actually making sure the rules are followed. "Bypass" means getting around them.
The report rates the issue P3 Medium. Severity ratings are labels a bug bounty programme uses to say how serious a finding is; P3 is a middle level, and Medium means it matters but is not the most urgent kind of problem. The report also marks its own status as illustrative and requiring validation, which means it is written as a demonstration of the idea and still needs to be confirmed on a real target.
The background you need
What an API is
When you use a website, your browser shows you pages with buttons and forms. Those pages do not store anything themselves. When you press a button, the browser sends a message to a computer somewhere else, called the server, and the server does the real work and sends an answer back.
An API (Application Programming Interface) is the set of addresses and message formats the server understands. A useful comparison is a restaurant: the menu and the waiter are the API. You do not walk into the kitchen and cook; you tell the waiter what you want in a fixed way, and food comes back. The page in your browser is one customer of that API. Any other program that knows the menu can also order, and the kitchen cannot tell who is asking.
That last point is the heart of this report. The page may refuse to send a bad password, but the API does not care where a request comes from. If you can send the request yourself, the page's refusal means nothing.
What a token is
A website needs to know who you are on every request, because each request arrives separately. After you log in, the server gives your browser a piece of text called a token (or a cookie, which is a small piece of data the browser stores and sends back automatically). You show the token with each request, like a wristband at an event: the door staff do not check your ID again, they just look at the wristband.
In this report the token is sent in an Authorization header. A header is a line of extra information attached to a request, separate from the main content. Authorization: Bearer <TEST_TOKEN> means "here is my token, let me in". The word Bearer simply means "whoever carries this token is treated as the owner".
What client-side and server-side mean
Client-side means the code running in your own browser, on your own computer. Server-side means the code running on the website's computer.
Client-side checks are convenient: they give instant feedback and save a round trip to the server. But they are entirely under the control of whoever is using the browser. Anyone can open developer tools, use a proxy, or write a small script and send whatever they like. So a client-side check is a courtesy, not a security control. Security rules must be repeated on the server, because that is the only part an attacker cannot edit.
What the vulnerability class means
The report files this under three weaknesses:
- CWE-521, Weak Password Requirements: the rules for acceptable passwords are too weak, or not applied.
- CWE-20, Improper Input Validation: the server accepts input it should have rejected.
- CWE-602, Client-Side Enforcement of Server-Side Security: a security rule exists only in the browser.
CWE is a public catalogue of weakness types, each with a number, so people can refer to the same idea consistently. OWASP A07, Authentication Failures, is a category from a well-known list of the most common web security risks; it covers problems with how a site proves who you are.
Setting up
To follow the steps you need three things:
- An authorised test account. "Authorised" means you have permission to test, for example an account the programme gave you or one you created on a site that invites testing. Testing accounts you do not own is not allowed.
- Burp Suite. This is a tool that sits between your browser and the website. Normally your browser talks straight to the server. With Burp in the middle, every request passes through it, and Burp can pause a request so you can read and edit it before it continues. Think of it as a post office that opens your letters, lets you rewrite them, and then sends them on.
- Access to the account password-change functionality, meaning you can reach the page where a logged-in user sets a new password.
The affected part of the site is described as the Account Management / Password Change API, reachable with the HTTP methods POST, PUT or PATCH. HTTP methods are verbs that say what kind of action a request is: POST usually means "create or submit", PUT and PATCH usually mean "update". The report does not name a specific website, product or version; the host in the request is a placeholder.
Finding it
The researcher's observation is that the password complexity rules appear to be enforced through client-side validation, without the same rules being consistently enforced on the backend. "Backend" is another word for the server side.
The frontend (the part you see) may require a minimum length, uppercase and lowercase characters, numbers and special characters. But if the backend does not independently check those requirements, it may accept passwords that do not satisfy the documented policy.
Why does that matter? Because a user could then set an easily guessable password, which reduces the effectiveness of the application's authentication controls. The interface explicitly prohibits the operation, but the API behind it may not. The page says no; the program behind the page might say yes.
Exploitation
Step 1: Access password settings
Log in using a controlled test account and navigate to the password-change page.
This step is about getting into the normal flow first. You want to see the feature working as intended before you interfere with it, so that any later difference is clearly caused by your change and not by something else.
Step 2: Identify the password policy
Review the password requirements displayed by the application, such as minimum length and character complexity. These are the rules you will later violate deliberately.
You need to know exactly what the rules are, because the test is "does the server accept something the rules forbid". Without knowing the rules, you cannot say whether a value breaks them. Read the text on the page, and also try typing a weak password into the form to see what message appears.
Step 3: Intercept the password-change request
Submit a valid password change and intercept the request using Burp Suite. "Intercept" means Burp catches the request and holds it, so you can look at it and change it before it reaches the server.
You start with a valid change on purpose. A request that the site is happy with shows you the exact shape of a correct request: the address, the headers, and the fields in the body. Once you know the shape, you can copy it and alter one piece.
The example request looks like this:
POST /api/v1/account/change-password HTTP/1.1
Host: <application-host>
Authorization: Bearer <TEST_TOKEN>
Content-Type: application/json
Line by line:
POST /api/v1/account/change-password HTTP/1.1is the first line of an HTTP request.POSTis the method, meaning "submit this data"./api/v1/account/change-passwordis the path, the address of the password-change function on the server.HTTP/1.1is the version of the protocol being spoken.Host: <application-host>tells the server which website name you are asking for. One server can host many sites, so this line says which one. The angle brackets mark a placeholder: in a real test you would put the actual hostname there.Authorization: Bearer <TEST_TOKEN>carries the login token for the test account, as described above. Again the value is a placeholder.Content-Type: application/jsontells the server how to read the body that follows. JSON is a simple text format for structured data, using curly braces, names in quotes, and values after colons.
The body of the request is separate from the headers and looks like this:
{
"current_password": "<CURRENT_TEST_PASSWORD>",
"new_password": "StrongPassword@123"
}
Line by line:
- The outer
{and}mark the start and end of one JSON object, which is a bundle of named values. "current_password": "<CURRENT_TEST_PASSWORD>"is the field holding the password the account has right now. The site asks for it as proof that the person making the change really knows the existing password, not just someone who found a logged-in browser."new_password": "StrongPassword@123"is the password you want to switch to.StrongPassword@123is a value that satisfies the displayed policy: it is long, it mixes upper and lower case, it has digits and a special character. So the request is expected to succeed through the normal flow.
The request targets the password-change endpoint with a bearer token for the test account. The JSON body carries the current password and the new password.
Step 4: Modify the password value
Replace the new password with a value that violates the application's stated policy:
{
"current_password": "<CURRENT_TEST_PASSWORD>",
"new_password": "123"
}
Line by line:
- The
current_passwordfield is unchanged. You still need it, because the server will check it. - The
new_passwordfield now holds123. This is far below any minimum length and contains no character variety, so the frontend would never have submitted it. The page's rules would not allow this value; here you are editing the message after it has left the page.
Only the new_password field changes. That is deliberate: changing one thing at a time means that if the server behaves differently, you know exactly what caused it.
Step 5: Forward the modified request
Send the request to the backend and inspect the response. The question to answer is whether the server rejects the password or accepts the modification.
A rejection means server-side policy enforcement exists: the server has its own copy of the rules and is applying them. An acceptance means the client-side check was the only barrier, and anyone who can talk to the API directly can set a password the policy forbids.
Step 6: Verify the result
Using the controlled test account, attempt authentication with the newly configured password. In other words, log out and try to log in with 123.
A successful password change using a policy-violating password confirms that backend policy enforcement is missing or inconsistent. This last step matters because a server might reply "success" while quietly not storing what you sent. Logging in with the weak password would prove the value was really saved and really works.
Root cause
The likely root cause is insufficient server-side enforcement of password complexity requirements. The application may rely on frontend validation, or it may fail to apply consistent password-policy rules across all password-management endpoints.
The underlying principle is that security requirements must be enforced by the backend, because client-side validation can be bypassed by anyone who can talk to the API directly. The report does not show the server-side code, so the exact mechanism is inferred rather than demonstrated.
Impact
The report lists the following consequences, all conditional on the backend actually accepting the weak password:
- Weak password adoption: users may be able to configure passwords that are easier to guess or crack. "Cracking" means trying huge numbers of guesses quickly with a computer.
- Reduced authentication security: weak password requirements can reduce resistance to password guessing and credential-stuffing attacks. "Credential stuffing" is when an attacker takes lists of usernames and passwords leaked from other sites and tries them here, betting that people reuse passwords.
- Inconsistent security controls: the backend may permit operations that the application's interface explicitly prohibits.
- Increased account compromise risk: if weak passwords are accepted, accounts may become more susceptible to password-based attacks.
The scenario involves an authenticated user acting on their own account, with low privileges required and no user interaction. "Low privileges" means you only need an ordinary account, not an administrator. "No user interaction" means no victim has to click anything for the issue to exist.
Fix
The report recommends the following remediation:
- Enforce password requirements on the server side.
- Apply consistent validation across registration, password changes, and password-reset workflows.
- Use a secure password policy aligned with current authentication guidance.
- Screen new passwords against commonly used and compromised password lists.
- Avoid relying exclusively on character-composition rules.
- Provide clear validation errors when password requirements are not satisfied.
- Add automated tests for direct API requests containing invalid passwords.
In plain terms: put the rules where the attacker cannot edit them, apply them everywhere a password can be set, and keep a test that sends a bad password straight to the API so the gap cannot quietly come back.
Variants to test
Once you understand the idea, there are several ways to look for the same weakness elsewhere:
- Other password-management endpoints. Try the same policy-violating value against registration, password reset and any administrative password-set endpoint. A positive result is the server accepting a password the interface would have refused.
- Different HTTP methods. The affected component is listed as POST, PUT or PATCH. If one method enforces the policy, try the others against the same resource. A positive result is one method accepting what another rejects.
- Boundary values. Submit passwords just below the stated minimum length, or with only one character class, rather than an obviously invalid value like
123. A positive result is acceptance of a value that is close to but outside the documented policy, which is harder to dismiss as a test artefact. - Field manipulation. Change the type or structure of the password field in the JSON body and observe whether validation still runs. A positive result is the server storing or accepting a value that bypasses the composition rules.
Hunting notes
This kind of bug tends to hide wherever a password policy is presented to the user as a set of rules in the interface: registration, password change, password reset and account recovery flows. The signal during recon is a client-side validation message or a disabled submit button tied to password strength. If the rule only exists in the browser, the API behind it is worth probing directly.
To show enough impact, the researcher's approach is to keep the test on a controlled account, demonstrate the policy violation through a direct API request, and then confirm it by authenticating with the newly set password. The report's own status line, illustrative and requiring validation, is a reminder to reproduce the full chain before reporting it.
Glossary
- API: the set of addresses and message formats a server understands, used by pages and other programs to ask it to do things.
- Authentication: the process of proving who you are, usually with a username and password.
- Authorization header: a line in a request that carries proof of identity, such as a token.
- Backend: the code running on the website's server, which the user cannot see or edit.
- Bearer token: a token where whoever holds it is treated as its owner.
- Boundary value: a value just at or just past a limit, such as one character below the minimum length.
- Burp Suite: a tool that sits between browser and server, letting you pause, read and edit requests.
- Client-side: code running in your own browser, on your own computer.
- Content-Type: a header saying what format the body of a request is in.
- Credential stuffing: trying username and password pairs leaked from other sites, hoping people reused them.
- CWE: a public catalogue of weakness types, each with a number.
- Endpoint: a specific address on a server that performs a specific function.
- Frontend: the part of a website you see and interact with in the browser.
- Header: a line of extra information attached to a request or response, separate from the main content.
- Host: the website name a request is addressed to.
- HTTP method: the verb of a request, such as POST, PUT or PATCH, saying what kind of action is wanted.
- Intercept: to catch a request in a tool and hold it before it reaches the server.
- JSON: a simple text format for structured data, using braces, quoted names and values.
- OWASP: an organisation that publishes a well-known list of common web security risks.
- Password policy: the rules describing what a password must look like.
- P3 Medium: a middle severity label used by bug bounty programmes.
- Placeholder: a stand-in value in an example, marked with angle brackets, to be replaced with a real one.
- POST / PUT / PATCH: HTTP methods; POST usually submits or creates, PUT and PATCH usually update.
- Proxy: a program that sits between two others and passes messages along, optionally letting you inspect them.
- Recon: the early stage of testing where you look around and note how a site behaves.
- Remediation: the changes recommended to fix a problem.
- Request body: the main content of a request, separate from its headers.
- Root cause: the underlying reason a weakness exists.
- Server: the computer that stores data and does the real work behind a website.
- Server-side: code running on the website's server.
- Severity: a label for how serious a finding is.
- Token: a piece of text proving you are logged in, sent with each request.
- Validation: checking that input meets the expected rules.
- Vulnerability: a weakness in a system that can be used to make it behave in ways it should not.