defects you only see when the app is running
Runtime & Integration Flaws (DAST)
Dynamic testing exercises the running system from the perimeter: reflected XSS, crash-under-malformed-input, and security misconfiguration. They are invisible to a static read of any single function -- you have to run the thing to see them.
DAST pokes the live app from outside; these bugs hide in behavior, not source.
In the wild
Reflected XSS
User input echoed into HTML unescaped runs as script -- a dynamic scan watches the alert fire.
// SMELL: user input echoed into HTML unescaped
app.get("/hi", (req, res) =>
res.send(`<h1>Hello ${req.query.name}</h1>`)); // name = <script>...
// RIGHT: escape on output (or use an auto-escaping template engine)
app.get("/hi", (req, res) =>
res.send(`<h1>Hello ${escapeHtml(req.query.name)}</h1>`));raw: <script>alert(1)</script> runs escaped: shown as literal text
Crash Under Malformed Input -> DoS
An unbounded, unvalidated parameter is a denial-of-service waiting to be fuzzed.
# SMELL: unhandled parse + unbounded work takes the worker down
@app.post("/calc")
def calc():
n = int(request.form["n"]) # "abc" -> ValueError -> 500, repeatable
return str(fib(n)) # n = 10_000_000 -> CPU exhaustion
# RIGHT: validate and bound before doing work
n = request.form.get("n", "")
if not n.isdigit() or int(n) > 1000:
abort(400)naive: 'abc' -> 500; huge n -> hung worker bounded: a clean 400, work stays cheap
Security Misconfiguration
Verbose errors and permissive defaults shipped to production are exposures a scanner finds at the perimeter.
// SMELL: debug errors and wildcard CORS shipped to production
app.use(errorhandler()); // leaks stack traces to clients
app.use(cors({ origin: "*" })); // any site can call your API
// RIGHT: prod-safe errors; lock the origin
if (PROD) app.use(genericErrorPage());
app.use(cors({ origin: ["https://app.example.com"] }));open: stack traces + any-origin requests locked: generic errors, allowlisted origins
# SMELL: a storage bucket left open to the world
resource "aws_s3_bucket_acl" "data" {
acl = "public-read" # anyone can list and read objects
}
# RIGHT: private by default; grant access explicitly
resource "aws_s3_bucket_acl" "data" {
acl = "private"
}public-read: objects exposed to the internet private: access only via explicit grants
Mapped weaknesses (CWE)
On its own, this defect is catalogued by MITRE as one or more of these weaknesses. The exploitable vulnerability usually appears only when it chains or combines with another.