feat: Add DevSecOps-4088 demo page with GHAS vulnerability showcase#139
Draft
feat: Add DevSecOps-4088 demo page with GHAS vulnerability showcase#139
Conversation
…ted packages Co-authored-by: CalinL <10718943+CalinL@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add DevSecOps demo page with GitHub Advanced Security news
feat: Add DevSecOps-4088 demo page with GHAS vulnerability showcase
Feb 10, 2026
| _logger.LogInformation($"Regex evaluation completed in {duration}ms for pattern: {pattern}"); | ||
| TempData["DemoMessage"] = $"Pattern '{pattern}' evaluated. Match: {matchResult}. Duration: {duration}ms"; | ||
| } | ||
| catch (RegexMatchTimeoutException ex) |
| _logger.LogInformation($"Serialized {LatestNews.Count} news items using Newtonsoft.Json"); | ||
|
|
||
| // Deserialize back (potential vulnerability with untrusted input) | ||
| var deserializedNews = JsonConvert.DeserializeObject<List<string>>(jsonData); |
| TypeNameHandling = TypeNameHandling.All | ||
| }; | ||
|
|
||
| string vulnerable = JsonConvert.SerializeObject(sampleData, settings); |
| catch (Exception ex) | ||
| { | ||
| // SECURITY VULNERABILITY: Logging full exception with potentially sensitive data | ||
| _logger.LogError($"JSON processing failed: {ex.ToString()}"); |
| catch (Exception ex) | ||
| { | ||
| // SECURITY VULNERABILITY: Logging full exception | ||
| _logger.LogError($"Regex test failed: {ex.ToString()}"); |
| } | ||
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"Search operation failed: {ex.ToString()}"); |
| // SECURITY VULNERABILITY: Log forging - user input directly in logs without sanitization | ||
| string userAgent = Request.Headers["User-Agent"].ToString(); | ||
| string ipAddress = Request.HttpContext.Connection.RemoteIpAddress?.ToString() ?? "unknown"; | ||
| string userName = Request.Query.ContainsKey("user") ? Request.Query["user"].ToString() ?? "guest" : "guest"; |
Comment on lines
+75
to
+79
| catch (Exception ex) | ||
| { | ||
| // SECURITY VULNERABILITY: Logging full exception with potentially sensitive data | ||
| _logger.LogError($"JSON processing failed: {ex.ToString()}"); | ||
| } |
Comment on lines
+93
to
+96
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"Database configuration error: {ex.Message}"); | ||
| } |
Comment on lines
+118
to
+121
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"Serialization demo failed: {ex.Message}"); | ||
| } |
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.
Adds new demo page demonstrating GitHub Advanced Security detection capabilities through intentional vulnerability injection.
Changes
DevSecOps-4088.cshtmlwith latest GHAS news content and interactive vulnerability demonstrationsDevSecOps-4088.cshtml.cswith ILogger implementation and multiple vulnerability categories:^(a+)+b$and nested quantifiers without timeoutTypeNameHandling.Allwith Newtonsoft.JsonExample Vulnerabilities
All vulnerabilities are clearly marked with
// SECURITY VULNERABILITY:comments for educational purposes.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.