Zend Framework

Zend_Service_Amazon_S3 - Incorrect IP address matching in createBucket method

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.3
  • Fix Version/s: 1.8.4
  • Component/s: Zend_Service_Amazon
  • Labels:
    None

Description

The regular expression used by the createBucket method to detect an IP address is incorrect. The period characters in the regular expression are not escaped causing detection of one or more numeric digits followed by any character.

Example:

createBucket detects a match and throws an exception when passed the bucket name bf6a1588-48ce-4900-9a62-7d08eab1a02f

Possible Solutions:

The current regular expression should have period characters escaped like so:
(\d+)\.(\d+)\.(\d+)\.(\d+)

Use a much more complex regular expression to detect all 4 numbers in the IP address are in the range 0..255:
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

Activity

Hide
Matthew Weier O'Phinney added a comment -

Assigning to Stas.

Show
Matthew Weier O'Phinney added a comment - Assigning to Stas.
Hide
Stanislav Malyshev added a comment -

Fixed, thanks.

Show
Stanislav Malyshev added a comment - Fixed, thanks.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: