Repository navigation
feat: plaintext credentials - #58
Merged
Merged
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.
Summary
The last actionable point of the manual audit under
tests-project/: passwords stored in a database without hashing (uploadbox/db.py:24).test: define plaintext credential storage), implementation follows.TaintKind.CREDENTIAL, outsideTaintKind.ALLon purpose: only credential-named parameters carry it, so ordinary input reaching a database write is a SQL injection question, never a plaintext credential one.NamedParametermodel: parameters whose name matches a pattern are sources of the given kinds, wherever the function is; the shippedmodels/credentialsplugin namespassword,passwd,pwdand their variants ascredentialsources and declares the password hashing functions ofhashlib,bcrypt,argon2,werkzeug,passliband Django as sanitisers of that kind. The database write sinks of the stdlib, SQLAlchemy and Django models carrySQL | CREDENTIAL, so no plugin has to re-register another plugin's sink.security/plaintext_credentials: aTaintDetectorfor theCREDENTIALkind at medium confidence by construction, a name being a hint;TaintDetectorgains aconfidenceclass attribute and lowers hotspots one step from it.get_db().execute(...), a connection returned by a project function: the taint engine now resolves a method called on what a known function returns through that function's summary, when it returns one external symbol.On the twelve repositories this adds two findings, both in
uploadbox/db.py: the registration insert at line 24, the line the audit cites, and the login query at line 31 that compares the password in clear, which the audit lists under the same point since comparing in clear implies storing in clear. A getter returning several possible symbols (getattr(g, '_database', None)or a fresh connection) resolves to the one the models know. Of the audit's seven recommendations, only private data served fromstaticis left, a Flask-specific deployment rule deliberately not modelled.