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

User input is not sanitize before making a request resulting to send all contents of db.json file. #128

Open
reny-pacheco opened this issue Oct 12, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@reny-pacheco
Copy link
Contributor

Description

User input is not sanitize before making a request.
Adding ../db as form input results to send the whole content of db.json file.

I suggest to sanitize user input before sending a request.

Screenshots

image

Additional information

No response

@reny-pacheco reny-pacheco added the bug Something isn't working label Oct 12, 2022
@Njong392
Copy link
Owner

Yikes! This is a huge security issue. Do you want to be assigned to this @reny-pacheco ?

@reny-pacheco
Copy link
Contributor Author

Yes, I like to work on this. Please assign to me.

@Njong392
Copy link
Owner

Sure thing. Assigned!

@Njong392 Njong392 added the hacktoberfest For hacktoberfest 2022 label Oct 12, 2022
@reny-pacheco
Copy link
Contributor Author

Hi @Njong392 , I already created a PR for this and its ready for review, Thanks. 😃

@reny-pacheco
Copy link
Contributor Author

Hello @Njong392 , @mathiasayivor , in relation to this issue, I found out that special characters in abbreviation is encoded when creating its .json file. And requesting s/o doesn't return its abbreviation.

Example: s/o ➡️ s%2Fo.json

Question: Is it advisable to allow contributors to add special characters to abbreviation?

@mathiasayivor
Copy link
Contributor

Hello @Njong392 , @mathiasayivor , in relation to this issue, I found out that special characters in abbreviation is encoded when creating its .json file. And requesting s/o doesn't return its abbreviation.

Example: s/o arrow_right s%2Fo.json

Question: Is it advisable to allow contributors to add special characters to abbreviation?

Yes, we definitely have to encode abbreviations with special characters, since those characters are not allowed as file names.

And yes, developers can encode abbreviations, but they must include mapping for the encoded version in the public/server/encodedAbbrMappings.json file.

Also, thanks for pointing this out, as I thought searching for encoded abbreviations was added after the last breaking change (#64) was merged
Why don't you include this fix in #129?

@reny-pacheco
Copy link
Contributor Author

Also, thanks for pointing this out, as I thought searching for encoded abbreviations was added after the last breaking change (#64) was merged Why don't you include this fix in #129?

Based on my understanding, fetching of abbreviations goes directly to /db/<abbrev>.json which sometimes contain the encoded abbrev.
Where is encodedAbbrMapppings.json used for? since the requested abbrev comes from /db/<abbrev>.json?

Also thanks for responding to my questions. 😃

@mathiasayivor
Copy link
Contributor

Also, thanks for pointing this out, as I thought searching for encoded abbreviations was added after the last breaking change (#64) was merged Why don't you include this fix in #129?

Based on my understanding, fetching of abbreviations goes directly to /db/<abbrev>.json which sometimes contain the encoded abbrev. Where is encodedAbbrMapppings.json used for? since the requested abbrev comes from /db/<abbrev>.json?

Also thanks for responding to my questions. smiley

The encodedAbbrMappings.json is to help us easily find the original version for encoded abbreviations.

@Njong392 Njong392 removed the hacktoberfest For hacktoberfest 2022 label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants