thiagohp commented on code in PR #61:
URL: https://github.com/apache/tapestry-5/pull/61#discussion_r3380856250


##########
THREAT_MODEL.md:
##########
@@ -0,0 +1,259 @@
+<!--
+SPDX-License-Identifier: Apache-2.0
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Threat Model — Apache Tapestry (5)
+
+## §1 Header
+
+- **Project:** Apache Tapestry — a **component-based Java web application 
framework**. Developers build pages
+  and components; Tapestry handles request dispatch, rendering, form/event 
processing, asset serving, and
+  serialization of some server-side state into the client (page activation 
context, form data) which it
+  validates and deserializes on postback *(documented — README; source 
`tapestry-core`, `tapestry-http`)*.
+- **Modelled against:** `apache/tapestry-5` `master`/HEAD (2026-05-31).
+- **Status:** **DRAFT — v0, not yet reviewed by the Tapestry PMC.** Produced 
by the ASF Security team via the
+  `threat-model-producer` rubric 
(<https://gist.github.com/potiuk/da14a826283038ddfe38cc9fe6310573>).
+- **Reporting / version-binding / legend** as in the sibling models. **Draft 
confidence:** ~12 documented /
+  0 maintainer / ~46 inferred. Each *(inferred)* routes to §14.
+
+**Framing note:** Tapestry is a *framework*. The **application developer** 
authors pages, components,
+templates, and event handlers — that code is **trusted** (§3). The **untrusted 
web client** sending requests,
+form posts, and activation-context URLs is the adversary (§7). The single most 
security-load-bearing
+mechanism is the **HMAC-protected serialized client state**: Tapestry 
round-trips serialized objects through
+the browser and deserializes them on return, so their integrity rests on a 
configured HMAC secret.
+
+## §2 Scope and intended use
+
+Intended use *(documented)*: build and serve a Java web application; clients 
interact over HTTP(S) with
+rendered pages, forms, and component events.
+
+Caller roles:
+
+- **Web client (untrusted)** — any browser/agent issuing requests, form posts, 
activation-context URLs.
+- **Application developer** — authors pages/components/templates/handlers and 
chooses where to use raw output,
+  uploads, whitelisting, HTTPS. **Trusted; out of model as adversary (§3).**
+- **Operator/deployer** — sets `tapestry.hmac-passphrase`, production mode, 
and deployment hardening.
+  **Trusted; out of model (§3).**
+
+**Component-family table:**
+
+| Family | Entry point | Touches outside process | In model? |
+| --- | --- | --- | --- |
+| Request dispatch + page activation | URL → page/event, activation context | 
— | **Yes** |
+| Serialized client state + **HMAC** | `t:formdata` / activation 
serialization, deserialize on postback | **deserialization** | **Yes 
(critical)** |
+| Rendering / template output | component render, output escaping | — | **Yes 
(XSS)** |
+| Forms + file upload | form submit, multipart upload | fs (temp) | **Yes** |
+| Asset serving | classpath/context asset URLs | filesystem/classpath | **Yes 
(traversal)** |
+| Access whitelisting | `@WhitelistAccessOnly`, 
`ClientWhitelist`/`LocalhostOnly` | client address | **Yes** |
+| Transport/link security | `RequestSecurityManager`, `LinkSecurity` 
(HTTP↔HTTPS) | network | **Yes** |
+| Tests / sample apps / docs | `tapestry-core/src/test/app1`, samples | — | No 
→ §3 |

Review Comment:
   Hello, @potiuk ! Why not tapestry-core/src/test (i.e. all internal testing 
code)? Nothing there ever gets deployed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to