Skip to content

Commit 7a9de57

Browse files
authored
Critical security fix - Extra fields added to request post ignore list (#6)
* [#3] Ensure valid json for header field values * Allow for custom post request ignore fields This also fixes a critical security bug that can expose django registration password information to the logs (password1 and password2)
1 parent c070c36 commit 7a9de57

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

auditing/middlewares.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
'AUDIT_RESPONSE_HTTPCODES',
2222
[i.value for i in http.HTTPStatus
2323
if i not in (200,201,202,301,302)] )
24-
AUDIT_REQUEST_POST_IGNORED = ('password', )
24+
25+
AUDIT_REQUEST_POST_IGNORED = getattr(settings,
26+
'AUDIT_REQUEST_POST_IGNORED',
27+
('password', 'password1', 'password2'))
2528

2629

2730
class HttpHeadersLoggingMiddleware(MiddlewareMixin):

0 commit comments

Comments
 (0)