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

Sanitize mongo queries (9 Skny.io warnings) #29

Open
rhanka opened this issue Dec 1, 2021 · 0 comments
Open

Sanitize mongo queries (9 Skny.io warnings) #29

rhanka opened this issue Dec 1, 2021 · 0 comments
Assignees
Labels

Comments

@rhanka
Copy link
Contributor

rhanka commented Dec 1, 2021

8 requêtes mongo dépendent de paramètres soit provenant de l'env, soit provenant de requêtes oracles sans sanitization, générant un risque d'injection SQL. Ces sources étant maîtrisées, le risque reste circonscrit, mais l'utilisation de fonctions simples de validation de format aideraient à supprimer totalement ce risque.

src/jobs/manual.js ligne 76:

      const raw = await rawJurinet.findOne({ _id: document.sourceId });

et 104:

          await decisions.replaceOne({ _id: document._id }, document, {

src/jobs/reimport.js ligne 98, 128, 208 et 252 :

              await decisions.replaceOne({ _id: normalized[process.env.MONGO_ID] }, normDec, {

src/jobs/sync.js ligne 192 & 349:

            await decisions.replaceOne({ _id: normalized._id }, normDec, {

src/jurica-utils.js ligne 233:

    const cursor = await rawJurinet.find({ _portalis: juricaDoc._portalis }, { allowDiskUse: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants