Skip to content

Commit

Permalink
fix security issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Sep 24, 2024
1 parent 9a7f490 commit f12a50b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion care/facility/api/serializers/patient_otp.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create(self, validated_data):
"Please do not share this Confidential Login Token with anyone else"
),
)
else:
elif settings.DEBUG:
print(otp, otp_obj.phone_number) # noqa: T201

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.

otp_obj.otp = otp
Expand Down
3 changes: 2 additions & 1 deletion care/utils/sms/send_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def send_sms(phone_numbers, message, many=False):
try:
mobile_validator(phone)
except Exception:
logger.error("Invalid Phone Number %s", phone)
if settings.DEBUG:
logger.error("Invalid Phone Number %s", phone)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
This expression logs
sensitive data (private)
as clear text.
continue
client = boto3.client(
"sns",
Expand Down
3 changes: 1 addition & 2 deletions config/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ def get_validated_token(self, url, token):
return self.open_id_authenticate(url, token)
except Exception as e:
logger.info(e, "Token: ", token)
err = {"detail": "Invalid Authorization token"}
raise InvalidToken(err) from e
raise InvalidToken({"detail": "Invalid Authorization token"}) from e

def get_user(self, validated_token):
user = User.objects.filter(username=settings.ABDM_USERNAME).first()
Expand Down

0 comments on commit f12a50b

Please sign in to comment.