Stop a hacker from obtaining the usernames from a system

Our forgot password page has been identified with a security issue that needs attention:

ISS-0003938 Web Inspect Open Medium Suspicious Files Found in Recursive Directory ****** Remove any unnecessary pages from the web server If any files are necessary restrict access to those that are not supposed to be publicly accessible Remove any backup files and temporary files that were on the server for development testing Please remove backup files alternative login files, files that contain functionality that are depreciated and any short cut files that developers use.

The flagged file is /js/pmailer_minimal.js. The concern stems from the presence of the following line in the .js file:

url: URL + '/login/forgot-password/request/'+ username,

This information can potentially be exploited by attackers to methodically guess usernames until they receive a positive response.

What actions should we take to address this issue? Should we modify our response mechanism or implement restrictions on retry attempts? Are there other effective solutions to consider?

It's important to note that if an attacker obtains a valid username, they could launch a brute force attack.

Your input on resolving this threat is invaluable. We welcome any and all suggestions to enhance our security practices.

Answer №1

Let me provide a unique perspective as a pentester.

Obtaining a list of individuals within a company is relatively simple through platforms like LinkedIn. Additionally, identifying potential passwords such as password dumps, weak variations like Pa$$w0rd, the company name, or common patterns can also be part of my process.

The challenge arises when trying to apply these credentials to a random web application that is publicly exposed. Understanding the username format - whether it's first.lastname, email, firstinitiallastname, or something else - allows me to attempt various combinations with different passwords. The ultimate objective is to identify at least one valid login credential, which then facilitates extracting the full list of legitimate users from the application itself.

A generic response on a login page significantly hampers our progress. If I can ascertain the correct username, I have the capacity to test up to 24 different passwords per user (one password attempt per user every hour to prevent triggering lockouts). In most cases, I manage to gain access to an organization's system within a day of undertaking this method.

If I cannot confirm the accuracy of the username, I am forced to explore every conceivable combination of usernames and corresponding potential passwords. This limitation typically restricts me to trying only 3-4 passwords for each potential user before the efforts become too exhaustive. Unless users opt for extremely predictable passwords, breaking into the application becomes increasingly challenging.

Occasionally, crosschecking usernames against other sections of the application, particularly the password reset feature, can offer insights. While valuable for verification purposes, this approach is not conducive to brute-forcing logins as it may trigger account locks or send alert notifications to IT if attempted excessively.

Similar to what another individual mentioned, I would categorize this scenario as a vulnerability. If successful in gaining unauthorized entry, I would include it in the final report. Otherwise, I would inform the IT team without formally documenting it. Some novice pentesters might exaggerate the significance of such findings in their reports, potentially causing undue alarm.

A precautionary measure that I often recommend involves implementing a threshold for total failed login attempts. User-specific lockout mechanisms are effective, but introducing additional safeguards for individuals attempting multiple passwords across all users can further enhance security. By monitoring and flagging excessive unsuccessful logins within a specific timeframe, organizations can swiftly detect and mitigate potential brute-force attacks.

Answer №2

Dealing with this issue is quite common. To effectively prevent it, consider displaying a generic message such as:

If the username you've entered exists in our system, a new password will be sent to you shortly.

This approach ensures that potential hackers are kept in the dark about whether the provided username is valid in your database or not.

Answer №3

It's often exaggerated the risk associated with pen testers who feel compelled to include as many findings in their reports, regardless of actual business impact. Usernames are typically not considered confidential information, so disclosing them is usually not a major concern.

I've noticed that those who emphasize this vulnerability may not have fully explored all its implications. They focus on simple solutions like displaying vague error messages for failed logins, but overlook more complex scenarios that would require significant changes to the system. For example, consider the registration process - by attempting to register with a username, it can reveal if it's already taken or not. Addressing this issue without affecting user experience significantly is challenging (although there are some suggestions in this question).

In this case, for this specific function, an alternative could be to request an email address instead of a username and send a generic "not found" email for unregistered users. This approach prevents enumeration through this particular feature while still assisting users who forget their login credentials. However, it's likely that usernames are being exposed in various other areas (like during registration) and this is just one aspect of a larger issue. Considering the low risk compared to potential benefits, this type of concern should be reevaluated in most situations. Usernames aren't classified as secret data – passwords serve that purpose.

Answer №4

Jan's suggestion to generalize messages is a smart approach.

Once your provided information aligns with our records, an email containing recovery details will be sent to [email protected]

An additional measure would be to monitor and limit password recovery requests from the same IP or session, potentially implementing temporary blocks for frequent requests. Consider utilizing Captcha options as well to decrease request rates.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having trouble accessing the URL route by typing it in directly within react-router?

Having some trouble getting dynamic routes to work with react router. Whenever I enter a URL like localhost:3000/5, I receive the error message "cannot GET /5". Here is how my router is configured: class App extends Component { render() { retu ...

Steps for opening a clicked link in a new tab:

I have a link on my page that I would like to open in a new tab when clicked, but it doesn't seem to be working. Can anyone offer some suggestions or help? So far, I've tried the following code: <a target="_BLANK" ng-href="{{news.url ...

Could someone provide clarification on this particular line of Apex code for me?

I'm completely new to Oracle Apex and I could use some guidance in understanding the code snippet I came across in a tutorial about app creation. After digging around, I suspect it might be JavaScript, but I'm not entirely certain. The scenario ...

Modifications to the selected input do not impact the current state of the model

Declare 3 select inputs with hierarchical data to be chosen: <select data-ng-model="current.manufacturer" data-ng-options="c.name for c in manufactures"></select> <select data-ng-model="current.mark" data-ng-options="c.name for c in current ...

Identify the position of a mouse click event when dots overlap

Experience this live demo on CodePen by visiting it here. 1) When you click on the grid, a first red point will be added. 2) Click on the grid again to add a second red point. 3) By clicking back on the first red point, you may notice that the coordinat ...

How to Serialize a Dictionary in C# Without Using the "key" and "value" Keywords

I am having difficulty serializing the data structure shown below into JSON: public class TestClass { public TestClass() { Translations = new List<Dictionary<string, Dictionary<string, string>>>(); } [JsonProp ...

I am experiencing an issue with my jQuery loop code not functioning properly when using the .each method within the loop

I am struggling with the following code. <input type="text" name="1" class = "inp<?=$p?>"> <input type="text" name="2" class = "inp<?=$p?>"> <input type="text" name="3" class = "inp<?=$p?>"> <input type="text" na ...

What is the method for determining the new point coordinates and direction vector after a rotation of degrees in three.js?

How can I determine the coordinates of point A to H after rotating a certain number of degrees and aligning them with direction vector (-42, 51, 11) using three.js? Thank you in advance for your help and please forgive any mistakes in my English. Best reg ...

What are the steps to compile Sencha Touch using sencha-touch.jsb3?

I've been working on modifying the bundled sencha-touch.jsb3 file in an effort to decrease the size of the framework code. Here's what I've done so far: First, I downloaded the Sencha SDK Tools from I then made edits to SenchaTouch/sen ...

Could ProtoRPC API be considered the default AJAX solution provided by GAE?

Looking ahead: developing an ajax interface for a gae/py application. Currently, my app has a basic html version that communicates with the datastore and updates the page each time. While it works fine, now it requires ajax functionality. I've experi ...

Toggle Visibility of Elements with Javascript and Html

I've been working on implementing a "Show All / Hide All" feature. Currently, clicking on the text opens the image and text individually. However, I am looking to add a functionality for expanding all divs at once. To see how it currently functions, ...

Every time I push my code to Heroku, the deployment runs smoothly. However, I encounter a frustrating 404 error when trying to access

When deploying my app, I encounter an issue where the .glb file in my three.js project receives a 404 resource not found error. Despite trying to adjust the file path without success, the deployment of the entire project is flawless. For local running, I a ...

Could anyone clarify the concept of how a function is able to be equivalent to zero?

function checkForSpecialCharacters(text) { var specialChars = [";", "!", ".", "?", ",", "-"]; for(var i = 0; i < specialChars.length; i++) { if(text.indexOf(specialChars[i]) !== -1) { return true; } } ...

Ensuring typescript req.user in Passport JS is always defined: Best practices

When utilizing Passport JS, the req.user within the route is considered potentially undefined. However, the middleware prior to my route method ensures that this scenario does not occur. How can I convey this information to TypeScript? Object may be &apos ...

Limit access to Google Fusion Table to specific types of maps. Eliminate Google Fusion Table for selected map formats

Currently, I am in the process of creating a web map using the Google Maps Javascript API. My objective is to display a Google Fusion Table containing buildings in Boston exclusively on a stylized map named "Buildings." When I switch to the Buildings map t ...

Adjust the stroke and fill colors of an SVG element when hovering over it

I am facing a challenge with an SVG image that I have: https://i.stack.imgur.com/r4XaX.png When hovered over or clicked, it should change to https://i.stack.imgur.com/EHRG2.png Current Icon <svg width="24" height="24" viewBox="0 0 24 24" fill="non ...

Including an additional row in a pre-existing table

My goal is to dynamically add a new row when a button is clicked, right after the row containing the button. To achieve this, I'm using jQuery (version 1.10.2) to handle the creation of new rows. The issue I'm facing is related to the behavior o ...

Transmitting C# data to a JavaScript script through JSON serialization. Issue encountered: Character invalid

I'm facing an issue with sending data from my Entity Framework database to a JavaScript script on my webpage. Below is the snippet of code from my MVC Controller: public ActionResult Index() { var wordsToShow = db.Words.Where(w => w.O ...

React JS issue with SVG linearGradient not displaying accurate values

Within my component, I am working with SVG paths and a linearGradient value passed down from the parent component through static data. The properties 'startColor' and 'stopColor' are used to define the gradient colors for each element. ...

A guide on implementing array properties in Vue 3

Currently learning the fundamentals, I have an array set up in the parent component (App.vue) data() { return { fruits: [ "apple", "pear", "cherry" ], }; }, I'm aiming to have three instances of the s ...