← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1872033] [NEW] catch TypeError exception,performing "pass" operation

 

Public bug reported:

catch TypeError exception,performing "pass" operation,this should be a
code vulnerability.

like this:nova/nova/api/validation/validators.py

def _validate_name(instance):
    regex = parameter_types.valid_name_regex
    try:
        if re.search(regex.regex, instance):
            return True
    except TypeError:
        # The name must be string type. If instance isn't string type, the
        # TypeError will be raised at here.
        pass
    raise exception.InvalidName(reason=regex.reason)

** Affects: nova
     Importance: Undecided
     Assignee: Qiu Fossen (fossen123)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Qiu Fossen (fossen123)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1872033

Title:
  catch TypeError exception,performing "pass" operation

Status in OpenStack Compute (nova):
  New

Bug description:
  catch TypeError exception,performing "pass" operation,this should be a
  code vulnerability.

  like this:nova/nova/api/validation/validators.py

  def _validate_name(instance):
      regex = parameter_types.valid_name_regex
      try:
          if re.search(regex.regex, instance):
              return True
      except TypeError:
          # The name must be string type. If instance isn't string type, the
          # TypeError will be raised at here.
          pass
      raise exception.InvalidName(reason=regex.reason)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1872033/+subscriptions