Skip to content

Commit

Permalink
fix: address codeql database query using user controlled source
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSlome committed Mar 21, 2024
1 parent f16f025 commit f6a8382
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/db/mongo/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.getRepos = async (query = {}) => {

exports.getRepo = async (name) => {
const collection = await connect(cnName);
return collection.findOne({ name: name });
return collection.findOne({ name: { $eq: name } });
};

exports.createRepo = async (repo) => {
Expand Down
2 changes: 1 addition & 1 deletion src/db/mongo/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const usersCollection = 'users';

exports.findUser = async function (username) {
const collection = await connect(usersCollection);
return collection.findOne({ username: username });
return collection.findOne({ username: { $eq: username } });
};

exports.getUsers = async function (query) {
Expand Down

0 comments on commit f6a8382

Please sign in to comment.