Skip to content

Heap buffer overflow in Oracle XML namespace parsing #1824

Closed

Description

@jiaoshuntian

Bug Report

IvorySQL Version

master、IvorySQL5.x

OS Version (uname -a)

Ubuntu 22.04.4 LTS

Configuration options ( config.status --config )

Current Behavior

register_ns_from_csting() allocates fixed 1024-byte StringInfo buffers for the namespace prefix and URL, then writes into them with memcpy() sized from the caller-supplied namespace string, with no bounds check. Any Oracle-compatible XML function that accepts an nsList argument (e.g. EXTRACTVALUE, UPDATEXML, INSERTCHILDXML, etc.) will trigger a heap buffer overflow — and corrupt heap metadata, crashing the backend — if the supplied namespace prefixor URL exceeds 1024 bytes.

Expected behavior/code

The prefix/URL should be written using a growable append (e.g. appendBinaryStringInfo()), so the buffer always matches the actual input length instead ofa fixed size, preventing arbitrarily long input from corrupting adjacent heap memory.

Step to reproduce

Call any Oracle-compatible XML function that accepts an nsList argument with a namespace prefix or URL longer than 1024 bytes to trigger the overflow. Exact reproduction SQL is withheld here in line with responsible disclosure; happy to share it privately with maintainers.

Additional context that can be helpful for identifying the problem

Activity

  1. self-assigned this
    on Sep 1, 2026
  2. added
    bug
    on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions