Language: TypeScript
Label: vulnerable
CWE: CWE-346 \u2014 Origin Validation Error
The product does not properly verify that the source of data or communication is valid.

Code:
	getTokenFromRequest: (req) => {
		if (req.headers['x-csrf-token']) {
			return req.headers['x-csrf-token'];
		} else if (req.body.csrf_token) {
			return req.body.csrf_token;
		}
	},