Commit Graph

352 Commits (25d23bd00b3a9cd7e95ce2635c5999b95ba9fdfb)

Author SHA1 Message Date
Petr Písař 6142d389db
Limit lenght to INT_MAX bytes in rfbProcessFileTransferReadBuffer()
This ammends 15bb719c03 fix for a heap
out-of-bound write access in rfbProcessFileTransferReadBuffer() when
reading a transfered file content in a server. The former fix did not
work on platforms with a 32-bit int type (expected by rfbReadExact()).

CVE-2018-15127
<https://github.com/LibVNC/libvncserver/issues/243>
<https://github.com/LibVNC/libvncserver/issues/273>

(cherry picked from commit 09e8fc02f59f16e2583b34fe1a270c238bd9ffec)
6 years ago
Slávek Banko f3f392caec
Merge tag 'LibVNCServer-0.9.12'
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
6 years ago
Christian Beier 14c24e2bcc
Fix comment style and be a bit more verbose
... explaining cedae6e6f9.
6 years ago
Christian Beier ffa449ad01
Merge pull request #238 from tetrane/pr-fix-use-after-free
Fix use-after-free and concurrent access segmentation fault
6 years ago
Christian Beier 15bb719c03
Error out in rfbProcessFileTransferReadBuffer if length can not be allocated
re #273
6 years ago
Christian Beier 139da17b6e
Merge pull request #267 from veyon/external-lzo
Allow to use global LZO library instead of miniLZO
6 years ago
Quentin BUATHIER 00bae113d5 Check the return code of pipe 6 years ago
Remi Gacogne 716bd27235
Fix -Wmisleading-indentation warnings 6 years ago
Tobias Junghans e66a8a17f3 Allow to use global LZO library instead of miniLZO
The complete LZO library nowadays is installed on many systems so we can
optionally make use of it and omit internal miniLZO implementation.
6 years ago
Christian Beier 1452b9a6ae
Merge pull request #259 from veyon/cursor-shift
LibVNCClient: fix integer shifts for cursor colors
6 years ago
Tobias Junghans 2411769962 LibVNCServer: properly use thread-local storage
The TLS macro never has been defined due to the missing
LIBVNCSERVER_HAVE_TLS macro. This revises the macro logic to also cover
Win32 builds with MSVC.
6 years ago
Christian Beier aa8a1aa768
Add SSL options to rfbUsage output 6 years ago
Christian Beier 162d716b4c
Merge branch 'fix-#242' 6 years ago
Christian Beier 495ffa3f3a
tightvnc-filetransfer: do not close stuff from within a thread
... as this crashes badly and the client is closed by the main thread machinery afterwards.

re #242
6 years ago
Tobias Junghans 09b2ed4381 Undef error codes before redefining them for WSA
Fixes compiler warnings about redefined macros from errno.h.
6 years ago
Tobias Junghans c422847e2c LibVNCClient: fix integer shifts for cursor colors
Shifting values > 32768 by 16 places can cause undefined results for
signed integers. Therefore cast color components to unsigned integer
before shifting.
6 years ago
Christian Beier 2d939267a1
tightvnc-filetransfer: when creating a new download thread, make sure the previous one ends
re #242
6 years ago
Christian Beier 73cb96fec0
tightvnc-filetransfer: wait for download thread end in CloseUndoneFileDownload()
...and use it when deregistering the file transfer extension.

Closes #242
6 years ago
Christian Beier f8912fee5a
tightvnc-filetransfer: refactor CloseUndoneFileTransfer() into two functions
...for closing upload and download separately.

re #242
6 years ago
Christian Beier 89419fb1a0
tightvnc-filetransfer: tie the download thread to the control structure
re #242
6 years ago
Christian Beier ca2a5ac02f
tightvnc-filetransfer: fix heap use-after-free
One can only guess what the intended semantics were here, but as every
other rfbCloseClient() call in this file is followed by an immediate
return, let's assume this was forgotton in this case.

Anyway, don't forget to clean up to not leak memory.

Closes #241
6 years ago
Christian Beier 502821828e
LibVNCServer: fix heap out-of-bound write access
Closes #243
6 years ago
Michele Calgaro 8c081c8888
Removed _BSD_SOURCE, _SVID_SOURCE, _GNU_SOURCE, _XOPEN_SOURCE.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
6 years ago
Christian Beier 459046efc0
websockets: remove Flash fallback
Closes #162
6 years ago
Christian Beier de3a2f46b5
httpd: send proper MIME type for Javascript files
re #148
6 years ago
DRC 7063f607e4
Fix compilaton with gcc 4.4.x
Closes #204

Signed-off-by: Christian Beier <dontmind@freeshell.org>
6 years ago
Quentin BUATHIER cedae6e6f9 Fix the concurrent issue hapenning between the freeing of the client and the clientOutput thread 7 years ago
Quentin BUATHIER 96e163bdae Fix use-after-free 7 years ago
Christian Beier 85fb69515c
crypto: move to common
As of now, only LibVNCServer makes uses of these digest functions _and_
they depend on sys/uio.h, but in the future LibVNCClient will need those
as well.
7 years ago
Eddie James dd873fce45 Tight: export SendCompressedData and SendTightHeader functions
These functions can be used to send already compressed jpegs to a
client, circumventing the usual rect/region update methods which
operate on a raw rgb framebuffer. Rename the functions with the usual
rfb prefix and add the prototypes in rfb.h.

Signed-off-by: Eddie James <eajames@us.ibm.com>
7 years ago
Christian Beier f23248a415
rfbserver: fix a typo 7 years ago
Christian Beier 449cbe9028
rfbserver: get rid of inttypes.h again 7 years ago
Petr Písař 28afb6c537 Limit client cut text length to 1 MB
This patch constrains a client cut text length to 1 MB. Otherwise
a client could make server allocate 2 GB of memory and that seems to
be to much to classify it as a denial of service.

The limit also prevents from an integer overflow followed by copying
an uninitilized memory when processing msg.cct.length value larger
than SIZE_MAX or INT_MAX - sz_rfbClientCutTextMsg.

This patch also corrects accepting length value of zero (malloc(0) is
interpreted on differnet systems differently).

CVE-2018-7225
<https://github.com/LibVNC/libvncserver/issues/218>
7 years ago
Slávek Banko 68cb29a12f Merge tag 'LibVNCServer-0.9.11' of https://github.com/LibVNC/libvncserver
Conflicts:
	CMakeLists.txt
	libvncserver/main.c
7 years ago
Wu Zongyong 2c2f103304 fix: the function should not return a value 8 years ago
Jocelyn Le Sage e8a1ca2035 Fixed compilation of websockets on system where there is no implementation of base64 functions. 8 years ago
Christian Beier ada4b4fc5a Merge pull request #158 from kempniu/gtk-vnc-0.7.0-compat
websockets: Ensure compatibility with gtk-vnc 0.7.0+
8 years ago
Christian Beier 051fe2a009
websockets: hide decode debug output per default 8 years ago
Christian Beier f48921becf
websockets: restore webSocketCheckDisconnect() to keep API compatibility 8 years ago
Andreas Weigel ef8d2852f5
remove potential 64 bit len overflow calculation 8 years ago
Andreas Weigel 5d9d6a8712
add decode support for continuation frames
use FIN bit and implement opcode 0x00

make consistent use of uint64_t for big frame sizes
8 years ago
Andreas Weigel a90a43cda5
remove Hixie-specific MD5 and check functions 8 years ago
Andreas Weigel 826e0f9e39
add generation wstest to cmake
add wstestdata.c, because the python data generation script has too many
dependencies

remove some redundance from jpeg test creation

add support for decoding close messages
8 years ago
Andreas Weigel f19d6ee225
add ws_decode tests
modify automake to include ws_decode test

add python frame generator for decode tests

modify configure to only include ws_decode test if preconditions are
fulfilled
8 years ago
Andreas Weigel a2322e7006
remove obsolete hixie protocol support 8 years ago
Andreas Weigel bcefa591cd
factor out hybi decode part to make it testable
remove direct dependency on rfbClientPtr structure in hybi decode
function(s)
8 years ago
Andreas Weigel aac95a9dcf
fix overflow and refactor websockets decode (Hybi)
fix critical heap-based buffer overflow which allowed easy modification
of a return address via an overwritten function pointer

fix bug causing connections to fail due a "one websocket frame = one
ws_read" assumption, which failed with LibVNCServer-0.9.11

refactor websocket Hybi decode to use a simple state machine for
decoding of websocket frames
8 years ago
Lioncash c550e1ac69 font: Fix a small resource leak in a failure case in rfbLoadConsoleFont()
The file handle wouldn't be closed in this instance.
8 years ago
Christian Beier 6cb0522ecb rfbInitServer: only init Winsock once 8 years ago
Christian Beier 5935c1be4f Add an rfbLogPError that shows something on WIN32 8 years ago