concept vulnerability in category spring

appears as: vulnerabilities, vulnerability, vulnerability, vulnerabilities, The vulnerabilities
Spring Security in Action

This is an excerpt from Manning's book Spring Security in Action.

Application-level security (figure 1.3) refers to everything that an application should do to protect the environment it executes in, as well as the data it processes and stores. Mind that this isn’t only about the data affected and used by the application. An application might contain vulnerabilities that allow a malicious individual to affect the entire system!

We should avoid using vulnerable dependencies. However, if we find ourselves using a vulnerable dependency by mistake, at least we don’t want to point this mistake out explicitly. Even if the dependency isn’t known as a vulnerable one, this could be because nobody has found the vulnerability yet. Exposures as the previous snippet could motivate an attacker to find vulnerabilities in that specific version because they know now that’s what your system uses. It’s inviting them to harm your system. And an attacker could use even the smallest detail against a system.

Response A:
{
    "status": 401,
    "error": "Unauthorized",
    "message": "Username is not correct",
    "path": "/login "
}
Response B:
{
    "status": 401,
    "error": " Unauthorized",
    "message": "Password is not correct",
    "path": "/login "
}

In this example, the responses A and B are different results of calling the same authentication endpoint. They don’t seem to expose any information related to the class design or system infrastructure, but they hide another problem. If the messages disclose context information, then they can as well hide vulnerabilities. The different messages based on different inputs provided to the endpoint can be used to understand the context of execution. In this case, they could be used to know when a username is correct, and only the password is wrong. And this can make the system more liable to a brute force attack. The response provided back to the client shouldn’t help in identifying a possible guess of a specific input. In this case, it should have better provided in both situations the same message: