NetworkPkg/Ip4Dxe: Reject IPv4 addresses ending with dot#12404
Open
AbuthahirM11 wants to merge 1 commit intotianocore:masterfrom
Open
NetworkPkg/Ip4Dxe: Reject IPv4 addresses ending with dot#12404AbuthahirM11 wants to merge 1 commit intotianocore:masterfrom
AbuthahirM11 wants to merge 1 commit intotianocore:masterfrom
Conversation
Issue: UI accepts invalid IPv4 addresses ending with a dot in the IPv4 Network Configuration page. Examples: - Local IP Address: 192.168.1.10. - Subnet Mask: 255.255.255.0. - Gateway: 2.2.2.2. - DNS Servers: 1.1.1.1. Root Cause: The function Ip4Config2StrToIp converts user-entered IPv4 strings into numbers. When an address ending with a dot like '1.1.1.1.' is entered, the code skips over the 4th dot, reaches the string's null terminator, and incorrectly treats it as valid. A proper IPv4 address must have exactly 3 dots, but the code never enforced this. Fix: Before skipping a dot, add a check: if already processed 3 dots, return EFI_INVALID_PARAMETER. This prevents accepting malformed inputs like '1.1.1.1.' or '1.1.1..1'. Signed-off-by: Abuthahir M <abuthahirm@ami.com>
mikebeaton
approved these changes
Apr 7, 2026
SaloniKasbekar
approved these changes
Apr 7, 2026
Author
|
@leiflindholm @ajfish @ardbiesheuvel @makubacki @mdkinney @Zclarkwilliams — Could you please take a look and approve this PR when you get a chance? |
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.
This PR fixes a validation issue where the IPv4 Network Configuration
UI accepts invalid IPv4 addresses ending with a dot.
The fix adds proper validation to reject addresses like:
After this fix, such malformed addresses are properly rejected with
an "Invalid" popup.
Cc: Saloni Kasbekar saloni.kasbekar@intel.com
Cc: Zachary Clark-williams zachary.clark-williams@intel.com
Cc: Michael D Kinney michael.d.kinney@intel.com
Signed-off-by: Abuthahir M abuthahirm@ami.com