Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tightvnc: add patches for CVE-2019-8287, CVE-2019-15678, CVE-2019-15679 & CVE-2019-15680 #73970

Merged
merged 1 commit into from Nov 24, 2019

Conversation

risicle
Copy link
Contributor

@risicle risicle commented Nov 23, 2019

Motivation for this change

https://nvd.nist.gov/vuln/detail/CVE-2019-8287
https://nvd.nist.gov/vuln/detail/CVE-2019-15678
https://nvd.nist.gov/vuln/detail/CVE-2019-15679
https://nvd.nist.gov/vuln/detail/CVE-2019-15680

These had to be adapted from patches fixing similar issues in the actively maintained libvnc @ https://github.com/LibVNC/libvncserver

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

@flokli
Copy link
Contributor

flokli commented Nov 23, 2019

Are these upstream somewhere and can be fetchpatch-ed?

@risicle
Copy link
Contributor Author

risicle commented Nov 23, 2019

There is no upstream. TightVNC 1.x is essentially abandoned, 2.x is proprietary. See https://www.openwall.com/lists/oss-security/2018/12/10/5 for more on their attitude. I had to track down & port these patches myself, which is why even debian don't have this fixed yet (I've sent them a link to this PR though).

Copy link
Contributor

@c0bw3b c0bw3b left a comment

Choose a reason for hiding this comment

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

Good job on adapting those patches to tightvnc 1.x
but running a nix-review I notice that vncviewer binary is now missing.

Seems those patches introduce some build failures

In file included from rfbproto.c:1270:
corre.c: In function 'HandleCoRRE8':
corre.c:59:25: error: 'RFB_BUFFER_SIZE' undeclared (first use in this function); did you mean 'ZLIB_BUFFER_SIZE'?
     if (hdr.nSubrects > RFB_BUFFER_SIZE / (4 + (BPP / 8)) || !ReadFromRFBServer(client, client->buffer, hdr.nSubrects * (4 + (BPP / 8))))
                         ^~~~~~~~~~~~~~~
                         ZLIB_BUFFER_SIZE
corre.c:59:25: note: each undeclared identifier is reported only once for each function it appears in
corre.c:59:81: error: 'client' undeclared (first use in this function); did you mean 'XEvent'?
     if (hdr.nSubrects > RFB_BUFFER_SIZE / (4 + (BPP / 8)) || !ReadFromRFBServer(client, client->buffer, hdr.nSubrects * (4 + (BPP / 8))))
                                                                                 ^~~~~~
                                                                                 XEvent
corre.c:59:63: error: too many arguments to function 'ReadFromRFBServer'
     if (hdr.nSubrects > RFB_BUFFER_SIZE / (4 + (BPP / 8)) || !ReadFromRFBServer(client, client->buffer, hdr.nSubrects * (4 + (BPP / 8))))
                                                               ^~~~~~~~~~~~~~~~~

Then in install phase

Copying vncviewer/vncviewer -> /nix/store/981ad5phnclvhihhvgzgll4yif6a9yfn-tightvnc-1.3.10/bin/vncviewer
cp: cannot stat 'vncviewer/vncviewer': No such file or directory

@risicle
Copy link
Contributor Author

risicle commented Nov 24, 2019

Ah - that would explain a few things - I assumed the package was slightly broken already (other binaries work), I hadn't thought to check for uncaught failures. I'll take a closer look at this.

… & CVE-2019-15680

mostly adapted from patches fixing similar issues in the actively
maintained libvnc
@risicle
Copy link
Contributor Author

risicle commented Nov 24, 2019

Fixed. I forgot to re-adjust changed variable names & call signature.

Copy link
Contributor

@c0bw3b c0bw3b left a comment

Choose a reason for hiding this comment

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

Builds and runs properly

Result of nix-review pr 73970 1

1 package were build:
  • tightvnc

@c0bw3b c0bw3b merged commit 2482f8b into NixOS:master Nov 24, 2019
@c0bw3b
Copy link
Contributor

c0bw3b commented Nov 24, 2019

@risicle thanks for this, I'll backport

c0bw3b pushed a commit that referenced this pull request Nov 24, 2019
Security fixes for:
* CVE-2019-8287
* CVE-2019-15678
* CVE-2019-15679
* CVE-2019-15680

mostly adapted from patches fixing similar issues in the actively
maintained libvnc

(#73970)

(cherry picked from commit 2482f8b)
c0bw3b pushed a commit that referenced this pull request Nov 24, 2019
Security fixes for:
* CVE-2019-8287
* CVE-2019-15678
* CVE-2019-15679
* CVE-2019-15680

mostly adapted from patches fixing similar issues in the actively
maintained libvnc

(#73970)

(cherry picked from commit 2482f8b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants