madmaze / htcpcp Goto Github PK
View Code? Open in Web Editor NEWBasic C implementation of "Hyper Text Coffee Pot Control Protocol" (HTCPCP) or RFC 2324. Final project for COMP400 (LAN/WAN - Summer '11)
Basic C implementation of "Hyper Text Coffee Pot Control Protocol" (HTCPCP) or RFC 2324. Final project for COMP400 (LAN/WAN - Summer '11)
HTCPCP server incorrectly handles incoming network messages leading to a NULL pointer dereference, resulting in crash of the server.
Proposed CVSS 3.0 score:
7.5 (High) - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Welcome to the potLogic CoffeeTr0n!
Ready to brew.. there are 5 Pots available
Created thread 0
Thread 0
Request:
D������g�rd�
Segmentation fault
./matrixssl-ASAN/apps/dtls/dtlsServer -p 44444
DTLS server running on port 44444
sslBuf = 0x61b00001e380 recvfromBuf = 0x61b00001f180 recvLen = 67
sslBuf = 0x61b00001ea80 recvfromBuf = 0x61b00001f180 recvLen = 1047
=================================================================
Created thread 0
Thread 0
Request:
D������g�rd�
ASAN:SIGSEGV
=================================================================
==21766==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f2af2a2f746 bp 0x7f2aefbfbd10 sp 0x7f2aefbfb498 T1)
#0 0x7f2af2a2f745 in strlen (/lib/x86_64-linux-gnu/libc.so.6+0x8b745)
#1 0x7f2af2ffb1a5 in __interceptor_strlen (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x701a5)
#2 0x40347b in splitVarVal (htcpcp_server_ASAN+0x40347b)
#3 0x40392b in CoffeeRequestHandler (htcpcp_server_ASAN+0x40392b)
#4 0x403e47 in thread (htcpcp_server_ASAN+0x403e47)
#5 0x7f2af2d756b9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76b9)
#6 0x7f2af2aab41c in clone (/lib/x86_64-linux-gnu/libc.so.6+0x10741c)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 strlen
Thread T1 created by T0 here:
#0 0x7f2af2fc1253 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x36253)
#1 0x404b09 in main (htcpcp_server_ASAN+0x404b09)
#2 0x7f2af29c482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
==21766==ABORTING
Reproduction:
Download and compile HTCPCP server.
Run HTCPCP server:
./htcpcp_server 44444
(using defork from Preeny package: https://github.com/zardus/preeny)
LD_PRELOAD=~/tools/preeny/defork.so ./htcpcp_server 44444
The stored responses with an Accept-Additions header incorrectly delimits additions with semicolons, when semicolons [";"] should be used per addition to denote additional "params" (see relevant section of RFC2324) or "accept-params" (see relevant section of RFC2616). While RFC2324 doesn't explicitly denote a separation character, a comma [","] is standard use for HTTP header ranges.
Your implementation of HTCPCP uses an Content-Type of "message/coffeepot" for BREW, even thought RFC 2324 clearly states that it should be "application/coffee-pot-command".
Please fix this ASAP.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.