Skip to content

fix: CVE-2019-5544#20

Open
andresmanelli wants to merge 3 commits intoopenslp-org:masterfrom
forssea-robotics:fix/CVE-2019-5544
Open

fix: CVE-2019-5544#20
andresmanelli wants to merge 3 commits intoopenslp-org:masterfrom
forssea-robotics:fix/CVE-2019-5544

Conversation

@andresmanelli
Copy link

@andresmanelli andresmanelli commented Jan 5, 2026

This PR has as intention to land the patch posted here (as reported in this comment).

Fixes #16

cc @jcalcote @urbasus

I'm not really sure if the Signed-off-by mention is correct in this context, I'd be happy to change that to whatever is more appropriate.

openslp has a heap overflow vulnerability that when exploited may result
in memory corruption and a crash of slpd or in remote code execution.

CVE-2019-5544 has been assigned to this issue.

VMware would like to thank the 360Vulcan team working with the 2019
Tianfu Cup Pwn Contest for reporting this issue to us.

VMware Security Response Center

Signed-off-by: Andrés MANELLI <amanelli@forssea-robotics.fr>
Signed-off-by: Andrés MANELLI <amanelli@forssea-robotics.fr>
@andresmanelli andresmanelli requested a review from urbasus January 5, 2026 09:31
/* urlentry is the url from the db result */
urlentry = db->urlarray[i];
if (urlentry->opaque != NULL) {
const int64_t newsize = size + urlentry->opaquelen;
Copy link
Contributor

@urbasus urbasus Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addition may overflow should size_t be uint32_t (e.g. x86).

To detect size_t overflow:

if (size > SIZE_MAX - urlentry->opaquelen)
{
  // overflow
}
else
{
  // no overflow
}

Alternatively:

const size_t newsize = size + urlentry->opaquelen;
if (size < newsize) { /* overflow */ }

HOWEVER, I'm not sure why the next line proposed compares newsize against INT_MAX. I could be missing something important. Overall I find it hard to review code for absence of overflow issues.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be ok?

          urlentry = db->urlarray[i];
          if (urlentry->opaque != NULL) {
-            const int64_t newsize = size + urlentry->opaquelen;
-            if (urlentry->opaquelen <= 0 || newsize > INT_MAX)
+            if (urlentry->opaquelen == 0 || (size > SIZE_MAX - urlentry->opaquelen))
             {
                SLPDLog("Invalid opaquelen %zu or size of opaque url is too big, size=%zu\n",

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, pushed.

Signed-off-by: Andrés MANELLI <amanelli@forssea-robotics.fr>
@andresmanelli andresmanelli requested a review from urbasus January 5, 2026 14:18
Copy link
Contributor

@urbasus urbasus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got no more review remarks.

I cannot afford to test it at the moment and therefore cannot formally approve it at this time. Wish you luck finding someone who does.

@andresmanelli
Copy link
Author

@urbasus I understand. Maybe @jcalcote ? Anyway, I'll leave this open. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants