Commit Graph

7 Commits

Author SHA1 Message Date
Mario Limonciello
76b54e7de4 Sanitize uploaded filenames in upload example to prevent path traversal
The upload example wrote each uploaded file using the filename supplied
verbatim in the multipart Content-Disposition header. A client could set
that filename to an absolute path or one containing "../" components and
cause the server to create or overwrite files outside the working
directory.

Reduce each client-supplied filename to its base name and reject the
request with 400 Bad Request if the result is empty, ".", "..", or
still contains a path separator (including colon for Windows drive
letters).
2026-07-27 10:56:49 -05:00
yhirose
40f7985e02 Update copyright year 2025-12-31 22:18:11 -05:00
yhirose
af73377611 Fix #1578 (#2171)
* Fix #1578

* Update README

* Update

* Update

* Update

* Update

* Update

* Update
2025-07-06 21:27:24 -04:00
yhirose
b4f808da74 Updated example/upload.cc 2020-01-10 18:38:38 -05:00
yhirose
58b2814fda Format code 2019-12-14 23:50:53 -05:00
yhirose
b9539b8921 Fixed build errors 2019-12-03 10:30:07 -05:00
yhirose
448de6a9c6 Added upload example 2019-11-28 18:51:05 -05:00