Skip to content

Integer Overflow in sldns_str2period function #637

@kobrineli

Description

@kobrineli

I've got an input to reach unsigned integer overflow error in sldns/parseutil.c:272 in sldns_str2period function, that leads to incorrect conversation from string to uint32_t. Also, other arithmetic in this function can lead to unsigned integer overflow. I have not found any checks to prevent this error, is that alright?

Steps to reproduce the behavior:

  1. Build docker container for unbound from https://github.com/ispras/oss-sydr-fuzz/tree/master/projects/unbound
  2. Run docker container and execute /unbound_fuzzers/fuzz_3_fuzzer overflow_input.txt with this input:
    overflow_input.txt
  3. You will see something like this:
    sldns/parseutil.c:272:7: runtime error: unsigned integer overflow: 440000633 * 10 cannot be represented in type 'unsigned int'
  • Unbound version: 7749d98
  • OS: ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions