🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.vms
Article #62

Re: ‘This Is Not a Drill’: Critical PHP Vulnerabilities Are Setting the Internet on Fire

#62
From: Arne Vajhøj
Date: Sat, 24 Oct 2026 19:10
184 lines
7187 bytes
On 10/23/2026 5:11 PM, Dan Cross wrote:
> The early web was a mess.  The protocol was hugely wasteful; the
> markup language was anemic, and people were resorting to all
> kinds of bad ideas to try and build content (constructing forms
> from tables, for example, so that boxes could be aligned).  The
> web had coalesced around an example from a book with a single
> addition, but like a high-school kegger, the word got out and it
> quickly got out of hand. A lot of non-technical people were
> authoring web pages and web sites by writing HTML directly.
> They didn't _want_ to become programmers.
> 
> CFML, ASP, and PHP stepped into that world and filled a bit of a
> void.  It inverted the model; you weren't writing programs to
> generate markup guided by the program's behavior, you were
> injecting behavior by embedding little snippets of programs in
> your markup.  The design-oriented types who wanted to focus on
> content could largely do that.  I don't think that has to be
> inherently insecure, though I can see how having someone around
> to add a bit of domain expertise to the mix can prevent a lot of
> problems down the road.  Textual interpolation is a powerful
> tool; so is a chainsaw.  Both can do a lot of damage.
No doubt that the switch from CGI to ASP and PHP changed
who could and who did make dynamic web pages.

But at the core ASP and PHP are really just a way to
save a gazillion "response write".

Here is super simple example of DCL CGI:

$ write sys$output "content-type: text/html"
$ write sys$output ""
$ write sys$output "<html>"
$ write sys$output "<head>"
$ write sys$output "<title>Show time</title>"
$ write sys$output "</head>"
$ write sys$output "<body>"
$ write sys$output "<h1>Show time</h1>"
$ write sys$output "<p>"
$ write sys$output "Time is " + f$time() + "."
$ write sys$output "</p>"
$ write sys$output "</body>"
$ write sys$output "</html>"
$ exit

(I chose DCL because with my Perl skills I would
not bother the Perl gurus here with my way of writing
Perl)

In PHP it becomes:

<html>
<head>
<title>Show time</title>
</head>
<body>
<h1>Show time</h1>
<p>
Time is <?php echo date('d-M-Y H:i:s', time()); ?>.
</p>
</body>
</html>

What is the real difference here? We avoid the response
write ($ write sys$output) for all the static pieces.
Making it a lot more readable.

It becomes even more clear if we look at JSP.

First a Servlet:

package test;

import java.io.*;
import java.text.*;
import java.util.*;

import javax.servlet.*;
import javax.servlet.annotation.*;
import javax.servlet.http.*;

public class TimServlet extends HttpServlet {
     private static DateFormat df = new SimpleDateFormat("dd-MMM-yyyy 
HH:mm:ss");
     public void doGet(HttpServletRequest request, HttpServletResponse 
response) throws ServletException, IOException {
         PrintWriter out = response.getWriter();
         out.write("<html>\n");
         out.write("<head>\n");
         out.write("<title>Show time</title>\n");
         out.write("</head>\n");
         out.write("<body>\n");
         out.write("<h1>Show time</h1>\n");
         out.write("<p>\n");
         out.write("Time is ");
         out.write(df.format(new Date()));
         out.write(".\n");
         out.write("</p>\n");
         out.write("</body>\n");
         out.write("</html>\n");
     }
}

And then an equivalent JSP:

<%@ page import="java.util.*,java.text.*" %>
<%!
private static DateFormat df = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
%>
<html>
<head>
<title>Show time</title>
</head>
<body>
<h1>Show time</h1>
<p>
Time is <% out.write(df.format(new Date())); %>.
</p>
</body>
</html>

Again we save a bunch of response write (out.write) for
all the static pieces.

(we also save some Java declaration overhead, but that
is just because Java is a bit verbose)

The interesting part is what happens under the hood. JSP
pages are not interpreted - they are compiled. Or more
precisely: they are triple compiled. The JSP compiler
compiles from JSP to Java source, the Java compiler
compiles from Java source to Java byte code and the
JVM JIT compiles from Java byte code to native code.

So we can look at the generated Java code:

package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.text.*;

public final class tim_jsp extends org.apache.jasper.runtime.HttpJspBase
     implements org.apache.jasper.runtime.JspSourceDependent,
                  org.apache.jasper.runtime.JspSourceImports {

private static DateFormat df = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");

   // lots of code not relevant for this example

   public void _jspService(final javax.servlet.http.HttpServletRequest 
request, final javax.servlet.http.HttpServletResponse respons
e)
       throws java.io.IOException, javax.servlet.ServletException {

       // more code not so relevant

       out.write('\n');
       out.write("\n");
       out.write("<html>\n");
       out.write("<head>\n");
       out.write("<title>Show time</title>\n");
       out.write("</head>\n");
       out.write("<body>\n");
       out.write("<h1>Show time</h1>\n");
       out.write("<p>\n");
       out.write("Time is ");
  out.write(df.format(new Date()));
       out.write(".\n");
       out.write("</p>\n");
       out.write("</body>\n");
       out.write("</html>\n");

       // more code not so relevant

   }
}

Basically the infrastructure has converted to JSP page to a
servlet with the tedious out.write generated.

Arne
Technical Details
Message-ID: <11bivpt$305om$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11bcbi1$k068$1@dont-email.me> <20261023123938.000065e7@yahoo.com> <11bfhnc$li2$1@reader2.panix.com> <nk1gv8F1eecU1@mid.individual.net> <11bgih8$f7a$1@reader2.panix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Arne Vajhøj <arne@vajhoej.dk>
Newsgroups: comp.os.vms
Subject: Re: ‘This Is Not a Drill’: Critical PHP Vulnerabilities Are Setting the Internet on Fire
Date: Sat, 24 Oct 2026 15:10:02 -0400
Organization: A noiseless patient Spider
Lines: 184
Message-ID: <11bivpt$305om$1@dont-email.me>
References: <11bcbi1$k068$1@dont-email.me> <20261023123938.000065e7@yahoo.com>
 <11bfhnc$li2$1@reader2.panix.com> <nk1gv8F1eecU1@mid.individual.net>
 <11bgih8$f7a$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 24 Oct 2026 19:09:50 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3151638"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/T1rLMri4SyC70Mdi7vceLCwGOwJILcKs="; posting-host="90629bce1c2634862ed525d6a667363b"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:lMn1K5Lv3Ffapa4o+qwAQP1vGB0= sha256:bH+LJ0eJNG16IWBfe+TPVijLi9ehlh+hd+kkVXswDgA=
	sha1:R0lrmH61cKv0nF2owfPGy3d/IyM= sha256:P+4hxcob+y6/g4xB6bdSPZsMKB0OGHv74RPtS8zji48=
In-Reply-To: <11bgih8$f7a$1@reader2.panix.com>
Content-Language: en-US