Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(plugin): include JSP and ASP.NET templates in scan inventories (#1345)

ilaigold3f6b6b09738b
diff --git a/plugins/codex-security/scripts/rank_preview.py b/plugins/codex-security/scripts/rank_preview.py
index 25772b209..f174c67ba 100644
--- a/plugins/codex-security/scripts/rank_preview.py
+++ b/plugins/codex-security/scripts/rank_preview.py
@@ -15,6 +15,8 @@ PREVIEW_SAMPLE_LINES = 10
_UTF16_BOMS = (b"\xff\xfe", b"\xfe\xff")
TEXT_CODE_EXTENSIONS = {
+ ".ascx",
+ ".aspx",
".c",
".cc",
".cfg",
@@ -22,6 +24,7 @@ TEXT_CODE_EXTENSIONS = {
".clj",
".cpp",
".cs",
+ ".cshtml",
".css",
".cts",
".cue",
@@ -42,6 +45,8 @@ TEXT_CODE_EXTENSIONS = {
".java",
".js",
".json",
+ ".jsp",
+ ".jspx",
".jsx",
".kt",
".kts",
@@ -57,6 +62,7 @@ TEXT_CODE_EXTENSIONS = {
".psd1",
".psm1",
".py",
+ ".razor",
".rb",
".rs",
".scala",
diff --git a/plugins/codex-security/tests/source_cases.py b/plugins/codex-security/tests/source_cases.py
index 0a832c9a9..ce2ccd585 100644
--- a/plugins/codex-security/tests/source_cases.py
+++ b/plugins/codex-security/tests/source_cases.py
@@ -65,6 +65,12 @@ SOURCE_CASES = (
("profile.EJS", "<% const count = 0; %>\n<p><%= count %></p>"),
("show.html.erb", "<% count = 0 %>\n<p><%= count %></p>"),
("card.phtml", "<?php $count = 0; ?>\n<p><?= $count ?></p>"),
+ ("index.jsp", "<% int count = 0; %>\n<p><%= count %></p>"),
+ ("list.jspx", "<jsp:scriptlet>int count = 0;</jsp:scriptlet>\n<p>${count}</p>"),
+ ("Index.cshtml", "@{ var count = 0; }\n<p>@count</p>"),
+ ("Counter.razor", "<p>@count</p>\n@code { int count = 0; }"),
+ ("Default.ASPX", "<% var count = 0; %>\n<p><%= count %></p>"),
+ ("Header.ascx", "<% var count = 0; %>\n<p><%= count %></p>"),
)
),
)