Inadequate input validation on API endpoint leading to self denial of service and increased system load.
An API endpoint accepted a malformed JSON value for the recipient field, causing the user's own process to enter a repeated error-handling loop. This prevented the user from accessing their account and added load to the system.
- Triaged in 8 days
- Fixed in 13 days
- Paid in 13 days
- Disclosed after 13 days
Summary by the program
Summary
A security researcher discovered an API payload that would send invalid data to their own user process, which would repeatedly fail to be handled correctly. This error handling loop prevented further access to their user account.
Details
The payload was a JSON object containing an empty string wrapped in an array as the value of the to key, sent to the say API endpoint via a websocket.
e.g. {"to": [""]}
Severity
The severity was limited to their own account, and was not replicable to other users or vulnerable to CSRF/redirection attacks. However, the looping error state also added increased load to the system, and unchecked, could have had knock on effects that would impact other users of the service.
Cause and resolution
The error was caused by inadequate input validation. A fix was released and verified by the researcher, who tested all other API endpoints for vulnerability in the process.
Credit
We're very grateful to Richard Clifford of Pentura for the extra effort put into researching this issue and confirming the fix, and for following responsible disclosure practices in reporting it to us.
This class of issue would normally be eligible for a smaller bounty, but we're increasing the amount to reward the extra effort put into researching the issue and verifying the fix across multiple endpoints.
Context
IRCCloud exposes an API RPC reference for its client, and one of the documented methods is say, which posts a message to a channel or conversation. Clients reach this endpoint over a websocket, sending JSON objects as the RPC payload. The payload sets the to key to an array containing an empty string.
The bug covered here is an input validation failure in that endpoint: a malformed to value put the caller's own user process into a repeating error handling loop, which locked the account out and added load to the backend.
Setup
The report describes a single researcher working against their own IRCCloud account through the normal websocket API. No special role, privilege or second account is mentioned, and no tooling beyond the ability to send JSON over the websocket is described. The precondition is simply an authenticated session able to call the say endpoint.
Finding it
The researcher was probing the say endpoint's handling of the to field and found that a value of the wrong shape was not rejected cleanly. Instead of returning an error and moving on, the user process kept failing to handle the payload, and the error handling loop that resulted prevented further access to the account.
Exploitation
Step 1: send a malformed to value to say
The payload is a JSON object whose to key holds an array containing an empty string:
This is sent to the say API endpoint over the websocket. The to field is given an array with an empty string element, and the report attributes the issue to inadequate input validation.
Step 2: observe the error loop
The user process repeatedly fails to handle the invalid data correctly. The looping error state blocks further access to the account, so the effect is a self denial of service against the caller's own user.
Root cause
The report attributes the issue to inadequate input validation: the say endpoint accepted a to value of the wrong type and shape and passed it into the user process, which had no correct path for handling it and kept re-entering its error handling. The report does not describe the validation code or the error handling logic itself, so the exact mechanism is not stated.
Impact
The severity was limited to the researcher's own account. The issue was not replicable against other users and was not a CSRF or redirection vector. The looping error state did, however, add increased load to the system, and the program notes that unchecked it could have had knock on effects impacting other users of the service.
Fix
A fix was released and verified by the researcher, who in the process tested all other API endpoints for the same vulnerability. The report does not describe the code change itself.
The program states that this class of issue would normally be eligible for a smaller bounty, and that the amount was increased to reward the extra effort spent researching the issue and verifying the fix across multiple endpoints. The program increased the amount above its usual level for this class of issue. Credit goes to Richard Clifford of Pentura for the extra effort researching the issue and confirming the fix.
Variants to test
- Send other type-confused values for destination-like fields (arrays, nested arrays, empty strings, null) to message-sending endpoints, and watch whether the account stays usable afterwards. A positive result is the account becoming unreachable while the error loop continues.
- Try the same malformed shapes against every other RPC method that takes an identifier or destination, since the researcher's follow-up covered all endpoints. A positive result is any endpoint that enters a repeating error state rather than returning a clean validation error.
- Watch server load while the loop runs. A positive result is increased load attributable to a single malformed request.
Hunting notes
This kind of bug hides in RPC and websocket APIs where a field's type is assumed rather than checked, particularly where the value is handed to a long-lived per-user process rather than validated at the edge. During recon, look for documented API references that describe field types loosely, and for endpoints that keep per-user state. The signal is a request that produces repeated errors instead of a single rejection.
On impact, the report is explicit about the limits: the effect was confined to the caller's own account and could not be aimed at other users. What carried the report was the secondary effect, increased system load with potential knock on effects for other users, together with the researcher's verification of the fix across all endpoints. That combination is what the program rewarded above its usual level for this class of issue.
What happened, in plain words
IRCCloud is a service that keeps you connected to IRC chat networks through a web browser or app. Its client talks to the servers through an API, a set of documented commands that programs use to ask a service to do things. One of those commands is called say, and its job is to post a message to a channel or a conversation.
A security researcher found that if you send the say command a destination value of the wrong shape, the server does not simply reject it. Instead, the part of the system that handles that one user keeps trying and failing to process the bad data, over and over. That repeating failure locks the user out of their own account and adds extra work to the servers.
The researcher reported it, the company fixed it, and the researcher checked the fix and also tested every other API command for the same kind of problem. The company paid a bounty of 500.00 USD and disclosed the report on 2015-10-12.
Background you need first
A few ideas come up throughout this report. Here they are from zero.
API. An API (Application Programming Interface) is the menu of commands a program can send to a service. Think of a restaurant: you do not walk into the kitchen, you order from the menu, and the kitchen sends back a dish. The API is the menu plus the rules for ordering.
RPC. RPC stands for Remote Procedure Call. It is a style of API where each command looks like calling a function: you name the function and hand it some values. IRCCloud publishes an API RPC reference for its client, which is a public document listing these commands and what values they take.
Endpoint. An endpoint is one specific command or address in an API. The say endpoint is the one that posts a message.
Websocket. A normal web request is like sending a letter: you ask, you get one answer, the conversation ends. A websocket is more like a phone call that stays open. The browser and the server keep a two way connection alive and can send messages back and forth at any time. Chat applications use websockets because messages arrive whenever someone types them, not only when you ask.
JSON. JSON is a simple text format for structured data. It uses curly braces for an object (a set of named values), square brackets for an array (an ordered list), and quotes for text. For example, {"to": [""]} is an object with one key, to, whose value is a list containing one empty piece of text.
Input validation. This is the check a program does on data arriving from outside before using it. It is like a bouncer at a door checking that you have the right kind of ticket. If the check is missing or too loose, unexpected data gets inside and the program may not know what to do with it.
Denial of service. A denial of service means making something unavailable to the people who should be able to use it. A self denial of service means you do it to yourself: your own request makes your own account unusable.
CSRF. Cross Site Request Forgery is an attack where a malicious website tricks your browser into sending a request to another site where you are logged in. The report notes this bug was not that kind of attack, so it could not be triggered against you by a third party page.
Bounty. A bug bounty is a reward a company pays to someone who reports a security problem to them privately instead of abusing it.
Context
IRCCloud exposes an API RPC reference for its client, and one of the documented methods is say, which posts a message to a channel or conversation. Clients reach this endpoint over a websocket, sending JSON objects as the RPC payload. The payload sets the to key to an array containing an empty string.
In plain terms: the chat program in your browser does not talk to the chat server directly. It sends commands to IRCCloud's API over that always open websocket connection, and each command is a small JSON object. The client sends commands to IRCCloud's API over the websocket, and each command is a small JSON object.
The bug covered here is an input validation failure in that endpoint: a malformed to value put the caller's own user process into a repeating error handling loop, which locked the account out and added load to the backend.
A user process here means the piece of server software that looks after one particular user's connection and state. Each user has their own, which is why the effect stayed with the person who sent the bad request.
Setup
The report describes a single researcher working against their own IRCCloud account through the normal websocket API. No special role, privilege or second account is mentioned, and no tooling beyond the ability to send JSON over the websocket is described. The precondition is simply an authenticated session able to call the say endpoint.
An authenticated session means the researcher was logged in, the same way you are logged in when you open your own account. The point of this section is that nothing exotic was needed: no administrator rights, no second victim account, just a normal logged in user sending a crafted command.
Finding it
The researcher was probing the say endpoint's handling of the to field and found that a value of the wrong shape was not rejected cleanly. Instead of returning an error and moving on, the user process kept failing to handle the payload, and the error handling loop that resulted prevented further access to the account.
Why probe the to field? Because that is where the destination comes from, and destinations are exactly the kind of value a program tends to assume is well formed. The researcher sent a to value of the wrong shape, and it was not rejected cleanly. A clean rejection would look like an error message saying the value is invalid. What happened instead was repeated failure inside the user process, which is the difference between a bouncer turning you away at the door and letting you in to wander around lost.
Exploitation
Step 1: send a malformed to value to say
The payload is a JSON object whose to key holds an array containing an empty string:
This is sent to the say API endpoint over the websocket. The to field is expected to identify a message destination; here it is given an array with an empty string element, which the endpoint does not validate before passing it on to the user process.
Line by line, in plain words:
- The outer curly braces
{and}mark a JSON object, a set of named values. "to"is the name of the field, the destination of the message.- The colon separates the name from its value.
[""]is the value: square brackets mean a list, and inside is one item,"", which is an empty piece of text with nothing between the quotes.- So the whole thing says: send a message whose destination is a list containing one empty string.
The report attributes the issue to inadequate input validation, without describing the validation code.
Step 2: observe the error loop
The user process repeatedly fails to handle the invalid data correctly. The looping error state blocks further access to the account, so the effect is a self denial of service against the caller's own user.
In everyday terms: imagine a form that, when filled in wrongly, does not show you an error but keeps re-submitting itself forever. The page never becomes usable again. Here the form is the user process, and the person who filled it in wrongly is the same person who can no longer use their account.
Root cause
The report attributes the issue to inadequate input validation: the say endpoint accepted a to value of the wrong type and shape and passed it into the user process, which had no correct path for handling it and kept re-entering its error handling. The report does not describe the validation code or the error handling logic itself, so the exact mechanism is not stated.
Type and shape are worth separating. Type means what kind of value it is: text, number, list, object. Shape means how it is arranged: a list of one item, a list of lists, an empty value. The report attributes the issue to inadequate input validation.
Impact
The severity was limited to the researcher's own account. The issue was not replicable against other users and was not a CSRF or redirection vector. The looping error state did, however, add increased load to the system, and the program notes that unchecked it could have had knock on effects impacting other users of the service.
This is the part that made the report matter. On its own, locking yourself out of your own account sounds minor, and the report is honest about that limit: you could not aim it at someone else. But every loop of that error handling costs the servers work. The program notes that unchecked, the increased load could have had knock on effects impacting other users.
Fix
A fix was released and verified by the researcher, who in the process tested all other API endpoints for the same vulnerability. The report does not describe the code change itself.
Testing all the other endpoints matters because the same mistake, trusting a value's type without checking it, tends to be repeated across a codebase. If one command forgot the check, its neighbours may have too. The researcher went through them all, which is the extra effort the program rewarded.
The program states that this class of issue would normally be eligible for a smaller bounty, and that the amount was increased to reward the extra effort spent researching the issue and verifying the fix across multiple endpoints. The program increased the amount above its usual level for this class of issue. Credit goes to Richard Clifford of Pentura for the extra effort researching the issue and confirming the fix.
Responsible disclosure means telling the company privately, giving them time to fix the problem, and only then letting the public know. It protects users who would otherwise be exposed while the bug is still open.
Variants to test
These are the follow-up checks suggested by the shape of this bug, useful if you are learning to hunt for similar issues.
- Send other type-confused values for destination-like fields (arrays, nested arrays, empty strings, null) to message-sending endpoints, and watch whether the account stays usable afterwards. A positive result is the account becoming unreachable while the error loop continues.
- Try the same malformed shapes against every other RPC method that takes an identifier or destination, since the researcher's follow-up covered all endpoints. A positive result is any endpoint that enters a repeating error state rather than returning a clean validation error.
- Watch server load while the loop runs. A positive result is increased load attributable to a single malformed request.
Type confusion is the general name for feeding a program a value of a different kind than it expects, such as a list where it wanted text. Null is a special value meaning nothing at all, distinct from an empty string, which is text with zero characters.
Hunting notes
This kind of bug hides in RPC and websocket APIs where a field's type is assumed rather than checked, particularly where the value is handed to a long-lived per-user process rather than validated at the edge. During recon, look for documented API references that describe field types loosely, and for endpoints that keep per-user state. The signal is a request that produces repeated errors instead of a single rejection.
Recon (reconnaissance) is the early stage of looking around a system to understand what it offers before trying anything. Validated at the edge means checked at the front door, before the request goes deeper into the system. Per-user state means information the server keeps about one specific user, such as their connection and settings. A long-lived process that holds state is a good place for a bad value to get stuck, because it does not simply finish and forget; it keeps running.
On impact, the report is explicit about the limits: the effect was confined to the caller's own account and could not be aimed at other users. What carried the report was the secondary effect, increased system load with potential knock on effects for other users, together with the researcher's verification of the fix across all endpoints. That combination is what the program rewarded above its usual level for this class of issue.
Glossary
- API: the documented set of commands a program can send to a service, like a menu you order from.
- API RPC reference: a public document listing an API's commands and the values each one takes.
- Authenticated session: a logged in connection, where the service knows which user is making requests.
- Bounty: a reward paid by a company for a privately reported security problem.
- CSRF (Cross Site Request Forgery): an attack where a malicious site tricks your logged in browser into sending a request to another site.
- Denial of service: making a service or account unavailable to the people who should be able to use it.
- Endpoint: one specific command or address within an API, such as
say. - Error handling loop: a state where a program keeps failing on the same input and retrying instead of stopping with a single error.
- Input validation: checking data that arrives from outside before using it, to confirm it is the right type and shape.
- JSON: a text format for structured data, using curly braces for objects, square brackets for lists and quotes for text.
- Null: a special value meaning nothing at all, different from an empty string.
- Per-user state: information a server keeps about one particular user, such as their connection and settings.
- Recon (reconnaissance): the early stage of exploring a system to understand what it offers.
- Responsible disclosure: reporting a security problem privately, giving the company time to fix it, then making it public.
- RPC (Remote Procedure Call): an API style where each command looks like calling a function with some values.
- Self denial of service: making your own account or session unusable through your own request.
- Type: the kind of a value, such as text, number, list or object.
- Type confusion: feeding a program a value of a different kind than it expects, such as a list where it wanted text.
- User process: the server software that looks after one user's connection and state.
- Websocket: a connection that stays open between browser and server so both sides can send messages at any time, like a phone call rather than a letter.