Dockerfile EXPOSE instructions that specify port numbers outside the valid TCP/UDP range (0–65535) are misconfigurations that can cause build or runtime errors and may lead to unintended network exposure or incorrect port mappings.
This rule inspects Dockerfile EXPOSE commands and requires the numeric port value (the portion before any /protocol suffix) to be an integer between 0 and 65535 inclusive. The policy flags EXPOSE entries where the parsed port number is greater than 65535. Ensure you declare ports as numeric values within the valid range. For example: