tabs to spaces, and add some input validation#2
Open
fbaew wants to merge 1 commit intoProtospace:masterfrom
Open
tabs to spaces, and add some input validation#2fbaew wants to merge 1 commit intoProtospace:masterfrom
fbaew wants to merge 1 commit intoProtospace:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of all, I'm not trying to start a holy war but I noticed too late that my IDE converted all the tabs in
__init__.pyto spaces and I couldn't be bothered making that a separate commit. If you care about this fix I will happily:I'm also happy to help with any testing/deployment effort.
Since it's hard to tell from the diff (due to all the tab->space business) the actual fix is in lines 77-103 of
server/__init__.py:Not sure if it's really of any practical concern, but the current implementation is vulnerable to SQL injection (either by way of a specially-crafted access card or by ripping off the card reader and interfacing with the pi directly). For example a card ID like
'or''=''--satisfies the "card ID must be 10 characters" requirement, but would result in a random (or maybe the first) card record in the DB being retrieved, possibly allowing access to the building. I'm not too strong on the hardware side but I think at least in the second scenario it is actually possible to inject arbitrary bytes (maybe the RFID reader always outputs hex characters but an attacker could put whatever they wanted on the wire).