X XFediYour place in the Fediverse
XFEDI

Conversation

ActivityPub
↳ In reply to a post

Another very simple option in #Vinyl_Cache is to limit the size of request bodies using std.cache_req_body(). This also has the added benefit that chunked transfer encoding is tuned into a request with a content-length, such that php can check it upfront against the maximum body size.

In the example, the maximum size should be adjusted accordingly.

#php2shell

https://vinyl-cache.org/docs/trunk/reference/vmod_std.html#std-cache-req-body

sub vcl_recv {
	# Avoid OOM in php
	if (! std.cache_req_body(1M) &&
	    (req.http.Content-Length || req.http.Transfer-Encoding)) {
		return(synth(413));
	}
vinyl-cache.orgVMOD std - Vinyl Cache Standard Module - Vinyl Cache version trunk documentation
↩ Reply ♡ 0 · ↻ 0 ↗ Original

Oct 21, 2026 · 20:54 UTC

Replies
↳ In reply to a post

Turned this into a short article. https://fosstodon.org/@vinyl_cache/117481311068491278

Good night

❞ Quoted postThe Vinyl Cache Project

New short article: How #Vinyl_Cache can help with #php2shell https://vinyl-cache.org/news/2026-10-21_php2shell.html

FosstodonThe Vinyl Cache Project (@[email protected])New short article: How #Vinyl_Cache can help with #php2shell https://vinyl-cache.org/news/2026-10-21_php2shell.html
↩ Reply ♡ 0 · ↻ 0 ↗ Original