Add DevSecOps-10309 demo page with intentional vulnerabilities for GHAS scanning#143
Draft
Add DevSecOps-10309 demo page with intentional vulnerabilities for GHAS scanning#143
Conversation
…ate packages Co-authored-by: CalinL <10718943+CalinL@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add DevSecOps page with news and logging issues
Add DevSecOps-10309 demo page with intentional vulnerabilities for GHAS scanning
Feb 12, 2026
Comment on lines
+100
to
+103
| var deserializedData = JsonConvert.DeserializeObject<List<string>>(jsonData, new JsonSerializerSettings | ||
| { | ||
| TypeNameHandling = TypeNameHandling.Auto // VULNERABILITY: Insecure setting | ||
| }); |
| public void OnGet() | ||
| { | ||
| // VULNERABILITY: Log forging - user input directly in logs without sanitization | ||
| string userInput = Request.Query.ContainsKey("user") ? Request.Query["user"].ToString() ?? "anonymous" : "anonymous"; |
| LoadLatestGHASNews(); | ||
|
|
||
| // Demonstrate ReDoS vulnerability | ||
| string testPattern = Request.Query.ContainsKey("pattern") ? Request.Query["pattern"].ToString() ?? "aaa" : "aaa"; |
Comment on lines
+54
to
+58
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging full exception details including stack trace | ||
| _logger.LogError($"Regex evaluation failed for pattern: {testPattern}. Error: {ex.ToString()}"); | ||
| } |
Comment on lines
+67
to
+70
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"Database connection failed: {ex.Message}"); | ||
| } |
Comment on lines
+132
to
+137
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging sensitive information and full stack trace | ||
| _logger.LogError($"Regex test failed for pattern: {pattern}. Exception: {ex.ToString()}"); | ||
| TempData["RegexError"] = "Pattern evaluation failed - potential ReDoS attack detected"; | ||
| } |
Comment on lines
+170
to
+175
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging detailed error information | ||
| _logger.LogError($"SQL execution failed for userId: {userId}. Error: {ex.ToString()}"); | ||
| TempData["RegexError"] = "SQL query failed"; | ||
| } |
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging full exception details including stack trace | ||
| _logger.LogError($"Regex evaluation failed for pattern: {testPattern}. Error: {ex.ToString()}"); |
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging sensitive information and full stack trace | ||
| _logger.LogError($"Regex test failed for pattern: {pattern}. Exception: {ex.ToString()}"); |
| catch (Exception ex) | ||
| { | ||
| // VULNERABILITY: Logging detailed error information | ||
| _logger.LogError($"SQL execution failed for userId: {userId}. Error: {ex.ToString()}"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New demo page showcasing GitHub Advanced Security capabilities through intentional security vulnerabilities and 2026 GHAS feature updates.
New Files
DevSecOps-10309.cshtml- Razor page with GHAS news, interactive vulnerability demos (ReDoS, SQL injection testing)DevSecOps-10309.cshtml.cs- Code-behind with ILogger and intentional security flawsIntentional Vulnerabilities
Implements patterns that GHAS code scanning should detect:
Package Changes
Downgraded to vulnerable versions for demonstration:
Newtonsoft.Json: 13.0.1 → 12.0.2 (GHSA-5crp-9r3c-p9vr)System.Text.Json: 8.0.4 (GHSA-8g4q-xg66-9fp4)Microsoft.Data.SqlClient: 5.0.2 (GHSA-98g6-xh36-x2p7)UI Updates
Added navigation link in
Index.cshtmlto new demo page.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.