-
Notifications
You must be signed in to change notification settings - Fork 238
[comp] Production Deploy #1859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[comp] Production Deploy #1859
Conversation
…#1858) Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
🔒 Comp AI - Security Review🔴 Risk Level: HIGH2 high CVEs in xlsx (Prototype Pollution, ReDoS) and 1 low CVE in ai; .env.example exposes sensitive var names and http endpoints; code accepts unsanitized uploads and user content (Buffer.from, filenames, LLM prompts). 📦 Dependency Vulnerabilities🟠 NPM Packages (HIGH)Risk Score: 8/10 | Summary: 2 high, 1 low CVEs found
🛡️ Code Security AnalysisView 4 file(s) with issues🟡 apps/api/.env.example (MEDIUM Risk)
Recommendations:
🟡 apps/api/src/questionnaire/questionnaire.service.ts (MEDIUM Risk)
Recommendations:
🔴 apps/api/src/questionnaire/utils/content-extractor.ts (HIGH Risk)
Recommendations:
🟡 apps/api/src/questionnaire/utils/question-parser.ts (MEDIUM Risk)
Recommendations:
💡 RecommendationsView 3 recommendation(s)
Powered by Comp AI - AI that handles compliance for you. Reviewed Dec 5, 2025 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
||
| for (const si of siMatches) { | ||
| // Extract text from both <t>...</t> and <d:t>...</d:t> (or any namespace:t) | ||
| const textMatches = si.match(/<[^>]*:?t[^>]*>([^<]*)<\/[^>]*:?t>/g) || []; |
Check failure
Code scanning / CodeQL
Bad HTML filtering regexp High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To fix the issue without changing existing functionality:
- Update the regular expression at line 538 to use the case-insensitive
iflag, so that it matches any casing oft(e.g.,<t>,<T>,<d:t>,<D:T>). - In JavaScript's
String.match()function, this means changing the regexp from/.../gto/.../gi. - Only this line (538) needs to be changed. No imports or other file edits are required.
-
Copy modified line R538
| @@ -535,7 +535,7 @@ | ||
|
|
||
| for (const si of siMatches) { | ||
| // Extract text from both <t>...</t> and <d:t>...</d:t> (or any namespace:t) | ||
| const textMatches = si.match(/<[^>]*:?t[^>]*>([^<]*)<\/[^>]*:?t>/g) || []; | ||
| const textMatches = si.match(/<[^>]*:?t[^>]*>([^<]*)<\/[^>]*:?t>/gi) || []; | ||
|
|
||
| let fullText = ''; | ||
| for (const match of textMatches) { |
| let fullText = ''; | ||
| for (const match of textMatches) { | ||
| // Extract just the text content between tags | ||
| const textContent = match.replace(/<[^>]*>/g, ''); |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
<script
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 2 months ago
To fully sanitize the extracted string content, especially from possibly hostile XML input, we should ensure all tags are removed, including scenarios where fragments can mask their presence. The best approach in this context is to repeatedly apply the tag-removal until no further tags remain, as described in the CodeQL recommendation. Alternatively, we could use a library to properly handle XML/HTML decoding; however, since the content seems to be simple text within <t> tags, a repeated .replace() loop is effective and non-intrusive.
Required changes:
- Update the sanitization at line 543 in
apps/api/src/questionnaire/utils/content-extractor.tsto repeatedly remove all tags until none remain. - No new imports are necessary unless opting for a third-party library. In this fix, use the repeated
.replace()approach. - The only change is in the block inside the
extractSharedStringsfunction where the text content is extracted by stripping tags, i.e., replace line 543 and possibly update the logic for full clarity.
-
Copy modified lines R542-R548
| @@ -539,8 +539,13 @@ | ||
|
|
||
| let fullText = ''; | ||
| for (const match of textMatches) { | ||
| // Extract just the text content between tags | ||
| const textContent = match.replace(/<[^>]*>/g, ''); | ||
| // Extract just the text content between tags, safely remove all tags by repeating replace | ||
| let textContent = match; | ||
| let previous; | ||
| do { | ||
| previous = textContent; | ||
| textContent = textContent.replace(/<[^>]*>/g, ''); | ||
| } while (textContent !== previous); | ||
| fullText += textContent; | ||
| } | ||
|
|
* chore(bun.lock): update package versions and lockfile configuration * chore(bun.lock): update @jridgewell/trace-mapping to version 0.3.31 --------- Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
|
|
#1861) * chore(api): update @ai-sdk/anthropic to version 2.0.53 and adjust tsconfig * chore(bun.lock): update package versions and lockfile configuration
* chore(api): update @ai-sdk/anthropic to version 2.0.53 and adjust tsconfig * chore(bun.lock): update package versions and lockfile configuration * chore(bun.lock): update @jridgewell/trace-mapping to version 0.3.31 * chore(bun.lock): update @jridgewell/trace-mapping to version 0.3.31 * chore(api): add adm-zip dependency to package.json
|
🎉 This PR is included in version 1.67.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.