Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added prettier config,api-rate-limit, updated README #25

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Conversation

nil2022
Copy link
Owner

@nil2022 nil2022 commented Jan 12, 2024

added prettier config,api-rate-limit, updated README

@nil2022 nil2022 self-assigned this Jan 12, 2024
Copy link

render bot commented Jan 12, 2024

.send(`User with userId '${userId}' and all it's data are deleted`);
} catch (err) {
console.log("Error: ", err.message);
res.status(400).send(err.message);

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML Medium

Exception text
is reinterpreted as HTML without escaping meta-characters.
/*** LOG FOR SUCCESSFULL PASSWORD CHANGE ****/
console.log(`Password for user '${userId}' updated!`);
/*** SEND RESPONSE TO USER FOR SUCCESSFULL PASSWORD CHANGE ****/
res.status(200).send(`Password for user '${userId}' updated!`);

Check failure

Code scanning / CodeQL

Reflected cross-site scripting High

Cross-site scripting vulnerability due to a
user-provided value
.
console.log(`Post Deleted for Title: "${titleReq}"`);
return res
.status(200)
.send(`Post Deleted Successfully! for Title: "${titleReq}"`);

Check failure

Code scanning / CodeQL

Reflected cross-site scripting High

Cross-site scripting vulnerability due to a
user-provided value
.
/******** SEND RESPONSE TO USER ABOUT DELETION **************/
res
.status(200)
.send(`User with userId '${userId}' and all it's data are deleted`);

Check failure

Code scanning / CodeQL

Reflected cross-site scripting High

Cross-site scripting vulnerability due to a
user-provided value
.
const user = await User.findOne({ userId: decoded.userId });

//check if title of post is already in DB or not
const titleCheck = await Post.findOne({ title: title });

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
Comment on lines +138 to +140
{
userId: userId,
},

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
Comment on lines +169 to +171
const user = await User.findOne({
userId: userId,
});

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
if (isPasswordValid != true) throw new Error("Password not correct");

//check posts with userId provided in DB
await Post.find({ user: userId });

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
await Post.find({ user: userId });

//deletes all posts of provided userId
Post.deleteMany({ user: userId }).exec();

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
Post.deleteMany({ user: userId }).exec();

//deletes the user with provided userId
User.findOneAndDelete({ userId: userId }).exec();

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query object depends on a
user-provided value
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant