Commit Graph

57 Commits (master)

Author SHA1 Message Date
Miklos Vajna 0ef5e740a4 fuzzer, clientsession: fix build
Probably went wrong in commit de985834e2
(wsd: simplify DocumentBroker construction, 2024-04-03).

Also init logging to avoid:

common/Log.cpp:664:16: runtime error: downcast of address 0x6070000005d0 which does not point to an object of type 'GenericLogger'
0x6070000005d0: note: object is of type 'Poco::Logger'

similar to how COOLWSD::innerInitialize() does it.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic16bb2f070e1f0e12204bcc2fc70303d8c1250c8
2024-05-13 08:29:07 +01:00
Miklos Vajna c3c80f00a6 wsd, clientsession: guard against negative w/h in clientvisiblearea
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I34435276afbdc02b6e820b630560608f16f3a0e0
2024-02-26 08:27:21 +00:00
Miklos Vajna c97e4e2720 admin: handle errors while decoding URLs
#9 0x7f1fb8b06ee7 in __cxa_throw (/usr/lib64/libstdc++.so.6+0xb7ee7) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #10 0x7f1fb808645b in Poco::URI::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool) (/usr/lib64/libPocoFoundation.so.92+0x15145b) (BuildId: 32601204eb877c998d0122c4bef1c7c08c8d0285)
    #11 0x55a887e4bb8b in Util::decodeURIComponent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/common/Util.cpp:830:9
    #12 0x55a8874b7547 in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:392:20

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I87f358d218e8774d5c82f1fb12e2f56898e7581e
2024-01-16 21:36:43 +01:00
Miklos Vajna 973d12b2a7 admin: improve error handling on bad json for updateroutetoken
terminate called after throwing an instance of 'Poco::JSON::JSONException'
...
    #11 0x7f70540e006a in Poco::JSON::ParserImpl::parseImpl(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) (/usr/lib64/libPocoJSON.so.92+0x4206a) (BuildId: 149b3c1772e35fcbe5692d435f1b06820707bad3)
    #12 0x556a70a9511b in Poco::JSON::Parser::parse(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /usr/include/Poco/JSON/Parser.h:202:9
    #13 0x556a70a9511b in JsonUtil::parseJSON(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Poco::SharedPtr<Poco::JSON::Object, Poco::ReferenceCounter, Poco::ReleasePolicy<Poco::JSON::Object>>&) /home/vmiklos/git/collaboraonline/online-fuzz/./common/JsonUtil.hpp:37:50
    #14 0x556a70a7edde in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:325:13

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Iebe0f5d689032a8b3c1e5d38c5ee80d344d1cbed
2024-01-09 14:13:46 +00:00
Miklos Vajna 28665d45d2 wsd, DocumentBroker: check for missing child process
wsd/DocumentBroker.cpp:2861:32: runtime error: member call on null pointer of type 'WSProcess'
    #0 0x55cbce63d7d9 in DocumentBroker::disconnectSessionInternal(std::shared_ptr<ClientSession> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/DocumentBroker.cpp:2861:32
    #1 0x55cbce66c74d in DocumentBroker::removeSession(std::shared_ptr<ClientSession> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/DocumentBroker.cpp:2764:13
    #2 0x55cbce944614 in ClientSession::_handleInput(char const*, int) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/ClientSession.cpp:886:24
    #3 0x55cbced66255 in Session::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/common/Session.cpp:271:13

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I2a6f830de82ec8189312e57e6554a57909a0aaaa
2024-01-08 09:13:27 -05:00
Miklos Vajna 89f080ba45 wsd: check for nullptr channel in AdminSocketHandler
This can happen like this:

    #8 0x7f14fdf4ec86 in std::terminate() (/usr/lib64/libstdc++.so.6+0xb7c86) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #9 0x7f14fdf4eee7 in __cxa_throw (/usr/lib64/libstdc++.so.6+0xb7ee7) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #10 0x55ddc5b906d2 in Poco::AutoPtr<Poco::Channel>::operator->() /usr/include/Poco/AutoPtr.h:232:4
    #11 0x55ddc5b7eb07 in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:236:13

Note how LOG_ANY() assumes that Log::logger().getChannel() is not
nullptr (so the caller has to check for it), while the more typical
variants with a log level like LOG_TRC() already do a similar check via
LOG_CONDITIONAL().

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I5e1379f33e6640fd07de673ef0d07b1d4d611c89
2023-12-01 15:35:39 +00:00
Miklos Vajna 07db53bb6e wsd: handle Poco::URISyntaxException in AdminSocketHandler::handleMessage()
terminate called after throwing an instance of 'Poco::URISyntaxException'
    #8 0x7f014e70dc86 in std::terminate() (/usr/lib64/libstdc++.so.6+0xb7c86) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #9 0x7f014e70dee7 in __cxa_throw (/usr/lib64/libstdc++.so.6+0xb7ee7) (BuildId: c74eca671e2dd0f063706372d103f8acef88f1e3)
    #10 0x7f014dcea45b in Poco::URI::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, bool) (/usr/lib64/libPocoFoundation.so.92+0x15145b) (BuildId: 32601204eb877c998d0122c4bef1c7c08c8d0285)
    #11 0x56496c48320b in Util::decodeURIComponent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/common/Util.cpp:800:9
    #12 0x56496bb21ec0 in AdminSocketHandler::handleMessage(std::vector<char, std::allocator<char>> const&) /home/vmiklos/git/collaboraonline/online-fuzz/wsd/Admin.cpp:84:20

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I07551d92be5ae677d1cf63f0f0092fb838583337
2023-11-29 15:41:00 +00:00
Miklos Vajna 1e125c7bdc Fix fuzzers build
- the HttpEcho build broke with commit
  08d9081280 (net: don't try to set
  TCP_NODELAY on local Unix sockets., 2023-10-30)

- fix an unused variable error from commit
  0631593c96 (wasm: proxy wopi documents,
  2023-11-06).

- the undefined reference to COOLWSD::ForKitProcId probably went wrong
  in commit 3f46c1db44 (kit-in-process:
  pure re-factor to a run-time function to flag this., 2023-11-20)

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0cf06d188860bdb2f795485a91c7634b596255aa
2023-11-29 15:41:00 +00:00
Miklos Vajna e4298ccf31 fuuzer, httpresponse: clear state before each run
The max input size is 16384, so in case the input is saved after each
run, then this can allocate ~300MB of memory. This is considerable
amount, given that the upper limit of the fuzzer process is 2GB.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ieedb6a537d5b539255ed8bacd79ff23db3c15e9f
2023-02-28 10:18:41 +01:00
Miklos Vajna 4278b601f6 wsd: fix missing tile cache check in ClientSession::getCommandValues()
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I59d0c4863493a02df7a05b98648eb235840f8060
2022-10-25 16:55:19 +01:00
Ashod Nakashian 81399bff64 fuzzers: fixup HttpEcho
This improves the performance of fuzzing
and removes the checks that can't be guaranteed.

And fixes a test failure.

Change-Id: I987fe15b098c00d9a3d60077f0581d2ef35e306c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian 41ea9d4930 fuzzers: add httpecho fuzzer script
Change-Id: Iab296461ac47d0ee23c23bf3629f7a08f77e238a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian 94a884ad0f fuzzers: add http corpus and dictionary
Change-Id: I1a59fd31cc8ddfd90a7e9d4d62455310e410cb88
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian 6fa5be7ecb fuzzers: more aggressive http::Response fuzzing
Change-Id: I5b714bddd6edc90ef0c8efdad42d5f78f3d74886
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Ashod Nakashian a87d1ae54f wsd: add HttpEcho fuzzer
This is a full round-trip http fuzzer.
It can achieve >1000 iterations per second
on a single 2 Ghz core, even while going
through the network loopback layer.
The advantage is that more networking code
is fuzzed this way, including not just
the http code, but also the sockets.

Change-Id: I75d21bd0e25221ee6621097a2605d62c4bb2ae4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-17 08:55:12 -04:00
Miklos Vajna 4433e03492 client session fuzzer: try harder to empty SocketPoll::_newCallbacks on shutdown
The DocumentBroker dtor adds a callback:

	#0  SocketPoll::addCallback(std::function<void ()> const&) (this=0x377dce0 <Admin::instance()::admin>, fn=...) at ./net/Socket.hpp:773
	#1  0x0000000000947db5 in Admin::rmDoc (this=<optimized out>, docKey=...) at wsd/Admin.cpp:544
	#2  0x0000000000bb8192 in DocumentBroker::~DocumentBroker (this=0x61900000e690) at wsd/DocumentBroker.cpp:579

So even if the fuzzer called Admin::instance().poll() on shutdown, there
was one more callback inserted to the list later, leading to OOM in the
long run.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0832d839b098407fa9e8aadb6f84388a85d62323
2022-05-31 15:10:51 +02:00
Miklos Vajna 262befc90e clientsession_fuzzer: fix missing UnitWSD
An alternative would be to tweak online-fuzz/wsd/DocumentBroker.cpp:534
to check for Util::isFuzzing(), but this is probably a better & more
generic way.

'./clientsession_fuzzer fuzzer/data/load' now works again.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4d9fa387597695ff0802b268bc4d86be51dbabb2
2022-01-21 14:52:31 +01:00
Andras Timar f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Andras Timar de3e09fde0 rename wsd protocol command 'loolclient' to 'coolclient'
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I506fe74bc5ebf183ed21721b40a45210373abf06
2021-11-17 11:59:35 +01:00
Miklos Vajna f569c2b496 log: don't try to get the channel of a non-existing logger
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic08043dac01b682184ff440b2f7d7f4f3df9522e
2021-07-15 09:01:16 +02:00
Miklos Vajna 57d3d0f391 http response: check if result would fit into chunkLen
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I6e3b73461653d2ab3cedaa3f6ca7fbfd2a826edb
2021-07-08 14:51:11 +02:00
Miklos Vajna 8f1621299b wsd: guard against negative counter in loolclient cmd
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If1b1b515015b8aae01f2d1a6cb6a98426e2b03a8
2021-06-04 14:31:57 +02:00
Miklos Vajna bc0401fc49 Make sure that double fits into uint64_t
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic521383f71c1865ae18fc880b79493c52285e29b
2021-05-31 08:54:06 +02:00
Miklos Vajna 7b89ce2961 ClientSession::_handleInput: avoid pointing to a temporary
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I048ce322111029847d78f917f071b1c0854dc116
2021-05-10 12:38:32 +03:00
Miklos Vajna f4759515be fuzzers: HttpResponse is a superset of HttpStatus
HttpResponse covers http::Response::readData(), HttpStatus covered
http::StatusLine::parse(). The first calls the second, so remove the
second.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I163819ca470b766a7bc4694a9c6cfe4919e17963
2021-04-28 09:02:08 +02:00
Miklos Vajna 9afe974848 Add a fuzzer for http::Response::readData()
And remove the httpheader one, which is not useful, since it uses Poco
for the actual parsing, it did not find anything. (If we switch away
from Poco there in the future, it's easy enough to restore it.)

Also fix some problems found by the fuzzer.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I254247c46ecc78c9c3e75aac4f10c441b0e10fb3
2021-04-23 17:54:36 +02:00
Miklos Vajna da11acd8c5 StatusLine::parse: handle non-null-terminated buffer with std::atoi()
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I51033bc4d3f97f5ae93abce1b5f19ef6a8b296d8
2021-04-23 15:32:21 +02:00
Miklos Vajna 415a834813 StatusLine::parse: only feed integers to std::atoi()
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I7591fd14fbdc7c1210ac8141cb78854e3f20fffd
2021-04-23 15:32:21 +02:00
Miklos Vajna 80c6562e59 Add a fuzzer for http::StatusLine::parse()
And fix an unhandled std::length_error it found.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I571cdd71caeda84820f2c64088966936637ce2bf
2021-04-23 09:02:21 +02:00
Miklos Vajna f720e280bf Add an initial libfuzzer based fuzzer for http::Header::parse()
Run the actual fuzzer like this:

./httpheader_fuzzer -max_len=16384 fuzzer/httpheader-data/

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I91afe44a632826cc15bd1c338bcc5234582e9674
2021-04-22 15:56:58 +02:00
Miklos Vajna c65d8e7c7f HttpRequest: add missing config.h include
fuzzers build was failing with:

	In file included from fuzzer/Admin.cpp:3:
	In file included from ./wsd/Admin.hpp:12:
	In file included from ./wsd/AdminModel.hpp:20:
	In file included from ./net/WebSocketHandler.hpp:18:
	./net/HttpRequest.hpp:667:31: error: expected ')'
		_header.add("Server", HTTP_SERVER_STRING);
				      ^
	./common/Common.hpp:62:51: note: expanded from macro 'HTTP_SERVER_STRING'
	#define HTTP_SERVER_STRING "LOOLWSD HTTP Server " LOOLWSD_VERSION
							  ^
	./net/HttpRequest.hpp:667:20: note: to match this '('
		_header.add("Server", HTTP_SERVER_STRING);
			   ^

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibc3905e3e62e0eb9788b750971916ff4a4937f12
2021-03-30 12:23:09 +02:00
Miklos Vajna 656af5d407 LOOLWSD::sendMessageToForKit: add error handling
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ib0ee205ce5620d09bee877148b52dc2f3342145d
2021-03-16 10:46:23 +01:00
Miklos Vajna 3c0e7707bd admin fuzzer: fix build
This went wrong in commit 693a2e19e3 (wsd:
SocketPoll::poll accepts chrono duration, 2020-12-14).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I04780d7a5ef8ba54530df7727f2fe4df59995fb9
2021-01-04 11:45:01 +01:00
Miklos Vajna f77c8076a7 wsd: fix crash on renderfont when the doc broker has no tile cache
Happens when renderfont is called without first loading a document.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1152d1f4b3f610364e22c406cda5494672f20aed
2020-12-21 10:23:56 +01:00
Miklos Vajna 10c1885a83 fuzzer-clientsession
The fuzzer ran out of memory, 955443527 bytes (79%) of the used memory
was this map.

Change-Id: I2dd84a094d3dd3d98618667e3c78591e2193bce2
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-30 10:17:43 +01:00
Miklos Vajna eb5c86a4d3 DocumentBroker::saveToStorage: guard against nullptr _storage
This can happen on a 'savetostorage' which is after a failed load.

Change-Id: Iad26bf6415c772c8646a119b0454c202873d6860
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-26 10:57:23 +01:00
Miklos Vajna 3ce20bae68 DocumentBroker::sendRequestedTiles: avoid nullptr _tileCache
Change-Id: I467c7ca451b4f72f4f1205e965be2dd602d6d69d
2020-10-08 11:59:08 +02:00
Miklos Vajna 2b546f72de document broker: handle tile request without tile cache
Change-Id: I5e0006cde07a84e6553db92627fdab943ac51d04
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103534
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-09-28 10:50:46 +02:00
Miklos Vajna a3fc39e325 libfuzzer: fix build
Also decrease the poll timeout to 0, otherwise testing each input would
now take 5 sec, rather than ~3 ms.

Change-Id: I1a4f347e5ec08a62d40131bfec3c504a19727323
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95437
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-03 16:39:45 +02:00
Ashod Nakashian 44f4e59b6b wsd: RequestDetails takes the service root as argument
This avoids depending on LOOLWSD's statics, which
makes adding unit-tests much more difficult due to
the high number of dependencies LOOLWSD pulls.

Adds a number of unit-tests for RequestDetails.

Change-Id: I9f1d56f80a633505c7ff548ec0e33ffe61f59f53
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95290
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2020-06-02 17:28:40 +02:00
Miklos Vajna eacf089363 libfuzzer: add initial documentation
So that one does not have to search back the commit messages to get the
commandlines to run these.

Change-Id: I3acfc0fa5b38577f22f6248a8ae0705e6af68940
2020-05-15 10:06:58 +02:00
Michael Meeks 34fc7fb6b7 Proxy: move requestDetails closer to ProxyProtocol.
Change-Id: I07c00ea1dad15fd70b658a04f722cbd516fd5c18
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94088
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-13 00:53:24 +02:00
Miklos Vajna 19745e2e44 libfuzzer: fix build
And bypass configuration access at two new places, so the fuzzer can
find more interesting failures.

Change-Id: I4c09172e781a7c6120b8c4befe1a84fdd74f2ddc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93617
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-07 14:04:57 +02:00
Michael Meeks 18c4301a1f Proxy: re-factor proxy handling into ServerURL and cleanup copy/paste.
Also adds ServiceRoot handling for clipboard.

Change-Id: I7bc6591130fcc7d693e59ab8561fb9e99f4e93d5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93578
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-05-06 23:12:12 +02:00
Miklos Vajna eeb4d53a1e admin_fuzzer: fix too large param to mem stats size setter
Change-Id: I30dfa5cd917769e05cfdd4fad2a0e5ee8cc79dfb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92568
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-20 15:44:21 +02:00
Miklos Vajna 72cfcf7f3e admin_fuzzer: fix too large param to cpu_stats_size setter
Don't pop an empty container, also use stol() so it does not throw
std::out_of_range.

Change-Id: Id81cb00ccfb0ecc234b8f6fa89edf5a0d8c6d353
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92524
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-20 11:18:05 +02:00
Miklos Vajna ec3341591b clientsession_fuzzer: fix build
Change-Id: If793ad5d23f5b33d92ccfb681b279821f04a362b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92397
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-17 09:57:15 +02:00
Miklos Vajna 946fa38a22 admin console: fix handling of out of range kill parameter
Catch that, similar to when handling an invalid argument.

Change-Id: I7405355f0b962673069dbd33dbab8c9e3042c4bf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91794
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-07 09:35:54 +02:00
Miklos Vajna fc88a872c2 admin console: log when JWTAuth::verify() doesn't have enough tokens
This is no longer a huge problem, but it's still a good idea to return
early in that case.

Found with the recently added admin_fuzzer, when I locally disabled the
StringVector safety checks for test purposes.

(If you view the diff with -U30, then you see that we access tokens[2]
later, so if size is < 3, we should give up.)

Change-Id: I46fc531fb042cc1485a17a9e994ad37e9ff0cd80
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91587
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-03 09:18:18 +02:00
Miklos Vajna a4e0a00bfe Add an initial libfuzzer based fuzzer for the admin console
Run the actual fuzzer like this:

./admin_fuzzer -max_len=16384 fuzzer/admin-data/

Change-Id: I5891df8033ff1837afce86775ee62447587f2f20
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91504
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-02 12:11:24 +02:00