What is Dynamic Application Security Testing?
DAST is an automated process of testing a running application from an external perspective (black-box testing) to identify security vulnerabilities that are only visible at runtime. Unlike SAST, which analyzes source code, DAST tests the application the same way an attacker would attempt to compromise it - by sending malicious requests, manipulating parameters, and looking for security gaps in the running system.
DAST vs. SAST - Key Differences
| Property | DAST (Dynamic) | SAST (Static) |
|---|---|---|
| When it tests | Runtime - the application must be running | Build time - static code analysis |
| Code access | Black-box - does not require source code | White-box - requires access to code |
| What it detects | Runtime vulnerabilities, configuration and deployment issues | Coding errors, unsafe patterns, potential vulnerabilities |
| False positives | Low - tests actual behavior | Higher - may flag safe code |
| Speed | Slower (hours for large applications) | Faster (minutes) |
| Vulnerability types | SQL injection, XSS, CSRF, auth issues, SSRF | Buffer overflows, race conditions, unsafe functions |
| Language | Language-agnostic (tests HTTP API) | Language-specific (Java, C#, Python...) |
| SDLC phase | QA, Staging, Pre-production | Development, PR reviews |
Best Practice: Combine SAST + DAST
You achieve the best results by combining both approaches. SAST reveals potential problems in code during development, while DAST verifies whether these vulnerabilities are exploitable in a real environment. This strategy is called "Defense in Depth" and covers both theoretical and practical security gaps.
How DAST Works
Typical DAST Scan Workflow
What DAST Detects
1. Injection Attacks
- SQL Injection: Manipulation of database queries through user input
- Command Injection: Execution of OS commands through unsanitized input
- LDAP/XML/XPath Injection: Injection into specific query languages
- Template Injection: SSTI (Server-Side Template Injection)
2. Cross-Site Scripting (XSS)
- Reflected XSS: Malicious script in URL/parameter reflected back to the user
- Stored XSS: Persistent XSS stored in the database
- DOM-based XSS: Client-side XSS through JavaScript manipulation
3. Authentication and Session Management
- Broken Authentication: Weak passwords, session hijacking, credential stuffing
- Session Fixation: Attacker fixes the victim's session ID
- Insecure Session Cookies: Missing Secure/HttpOnly/SameSite flags
- JWT Vulnerabilities: Weak signing, algorithm confusion
4. Broken Access Control
- IDOR (Insecure Direct Object References): Accessing other users' objects by changing the ID
- Path Traversal: Accessing files outside webroot (../../../etc/passwd)
- Privilege Escalation: Regular user gains admin privileges
- Missing Function Level Access Control: API endpoints without authorization
5. Security Misconfiguration
- Verbose Error Messages: Stack traces revealing internal information
- Default Credentials: Admin/admin, root/root
- Directory Listing: Visible directory structures
- Missing Security Headers: CSP, HSTS, X-Frame-Options
- Exposed Admin Panels: /admin, /phpmyadmin, /wp-admin without protection
6. Other Runtime Vulnerabilities
- CSRF (Cross-Site Request Forgery): Unauthorized actions on behalf of a user
- SSRF (Server-Side Request Forgery): Server makes a request to an attacker-chosen target
- XXE (XML External Entity): Reading files through the XML parser
- Insecure Deserialization: RCE through deserialization of untrusted data
- Business Logic Flaws: Race conditions, price manipulation
Popular DAST Tools
OWASP ZAP (Zed Attack Proxy)
The most popular open-source DAST tool. Ideal for beginners and professionals alike, with both GUI and CLI modes.
- Active and passive scanning
- Intercepting proxy for manual testing
- Spidering and automatic crawling
- API scan (REST, GraphQL, SOAP)
- CI/CD integration (Docker, Jenkins, GitLab)
- 1000+ security checks
Burp Suite Professional
Industry-standard penetration testing platform with advanced features for both manual and automated testing.
- Burp Scanner - automated vulnerability scanner
- Intruder - advanced fuzzing engine
- Repeater - request manipulation
- Collaborator - out-of-band detection (SSRF, XXE)
- Extensions (BApp Store)
- $449/year for Professional license
Nuclei
A modern fast vulnerability scanner based on YAML templates. Ideal for CI/CD automation.
- 4000+ community templates
- Fast parallel scanning
- Custom templates in YAML
- Integration with Slack, Jira, GitHub
- Headless browser support
Acunetix
Enterprise-grade web vulnerability scanner focused on complex JavaScript applications.
- Advanced JavaScript/SPA crawling
- Network security scanning
- Integration with WAF (Web Application Firewall)
- Issue tracking (Jira, GitHub)
Nikto
A classic web server scanner for detecting known vulnerabilities and misconfigurations.
- 7000+ potentially dangerous files/programs
- Outdated server versions detection
- Server misconfigurations
- Fast, lightweight CLI tool
StackHawk
A modern DAST platform focused on API security and a developer-first workflow.
- OpenAPI/Swagger integration
- GraphQL endpoint testing
- CI/CD native (GitHub Actions, GitLab CI)
- Developer-friendly reporting
- Shift-left DAST approach
Practical Example: OWASP ZAP in CI/CD
Integrating OWASP ZAP into a GitLab CI/CD pipeline:
GitHub Actions Example
Docker Compose for Local DAST Testing
DAST Best Practices
Recommended Practices
- Test on staging/QA, not on production: DAST can cause DOS, data corruption, or trigger alarms
- Use test credentials: Dedicated test accounts for authenticated scanning
- Rate limiting awareness: DAST generates many requests; you may be blocked by WAF/CDN
- Baseline vs Full scan: Baseline for every PR, Full scan weekly or before release
- Custom scan policies: Disable tests that are not relevant (e.g., CMS scan for an API-only app)
- Authentication context: Configure ZAP/Burp for the login workflow; test authenticated areas
- API specification: Use OpenAPI/Swagger specs for better coverage of API endpoints
- False positive management: Review and mark FPs; create whitelists
- Trend tracking: Monitor the number of vulnerabilities over time, not just the current state
- SIEM integration: Send DAST findings to a centralized security dashboard
Common DAST Mistakes
- Running DAST on production: Can cause outages, corrupt data, or false alarms
- Insufficient crawling scope: Scanner fails to find all endpoints (especially with SPAs)
- Ignoring false positives: Teams lose trust in the tool
- Automated scans only: Manual pentesting finds business logic flaws that DAST cannot detect
- No authentication: 80% of the application is behind login; scanning only the homepage is insufficient
- One scan = done: DAST should run continuously, not just before release
- Outdated scanners: New CVEs and attack vectors require fresh vulnerability checks
DAST for Different Application Types
1. REST API
2. GraphQL API
3. Single Page Applications (SPA)
DAST vs IAST vs RASP
| Tool | How It Works | Advantages | Disadvantages |
|---|---|---|---|
| DAST (Dynamic) |
Black-box testing of a running application from the outside | No code access needed, language-agnostic, low false positives | Slow, does not pinpoint exact code location, requires a running application |
| SAST (Static) |
Source code analysis without execution | Fast, early detection, exact code location | Higher false positives, language-specific, cannot see runtime issues |
| IAST (Interactive) |
Agent inside the application monitoring runtime behavior | Accurate, low FP, code-level insights + runtime context | Requires instrumentation, performance overhead |
| RASP (Runtime Protection) |
Active defense in production - blocks attacks in real time | Production security, zero-day protection, virtual patching | Performance impact, false positives can block legitimate users |