-
Notifications
You must be signed in to change notification settings - Fork 611
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
fix(amf): Correct MSIN decoding for SUCI Profile B #15499
base: master
Are you sure you want to change the base?
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
The fix works for MSIN decoding with ProfileA as well. Tested with UERANSIM version 2134f6b |
@jordanvrtanoski Please check this PR. From my side, it's ready to go. |
- Update M5GSUCIRegistrationServiceClient.cpp for proper SUCI handling - Modify nas_proc.cpp to fix MSIN decoding process - Adjust test_amf_procedures.cpp for debugging Signed-off-by: kmu-tm <kamar.mubasier@telenormaritime.com>
7b3d321
to
a65903b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a security POV the positive is better logging and less fragile memory access and the negative is more complexity / surface area.
Overall this is a clear win.
Summary
This simple PR fixes the issue with SUCI Profile B, as reported in #15444. The problem was the incorrect decoding of the MSIN. For example, the decoded IMSI was 99970008000, but the actual IMSI was 999700000068375 (as shown in the logs)
To sum up, the AMF failed to correctly parse the MSIN from the database which led to the IMSI being incorrect and the authentication procedure failing. The MSIN is received as 5 bytes of raw binary data in BCD (Binary Coded Decimal) format, with each byte representing two digits in reverse order. The original code assumed that the MSIN was a string of 10 digits and attempted to convert this in a wrong format (this resulted in the values being decoded incorrectly).
This PR changes the following:
There will be a new PR submitted for the SUCI documentation (there are some confusion regarding key generation).
Test Plan
The UEs that were tested w/ Profile B were IPhone and IPad using test keys from 3GPP TS.
Additional Information
EDIT: I am just going through the updates from v1.8. I do find it a bit odd that this issue was mentioned in the release notes here. Could there have been a rollback?
Security Considerations