Skip to content

[dev] [Marfuen] mariano/automation-improvements#1752

Merged
Marfuen merged 2 commits intomainfrom
mariano/automation-improvements
Nov 14, 2025
Merged

[dev] [Marfuen] mariano/automation-improvements#1752
Marfuen merged 2 commits intomainfrom
mariano/automation-improvements

Conversation

@github-actions
Copy link
Contributor

This is an automated pull request to merge mariano/automation-improvements into dev.
It was created by the [Auto Pull Request] action.

…improvements

- Add automation activity feed and indicator components for task automation status
- Implement modern task list and category views for better task organization
- Introduce search input for filtering tasks
- Refactor task status handling and improve UI elements for better user experience
- Update task body and status selector components for enhanced functionality
@vercel
Copy link

vercel bot commented Nov 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
app Ready Ready Preview Comment Nov 14, 2025 10:01pm
portal Ready Ready Preview Comment Nov 14, 2025 10:01pm

@comp-ai-code-review
Copy link

comp-ai-code-review bot commented Nov 14, 2025

🔒 Comp AI - Security Review

🔴 Risk Level: HIGH

OSV scan: 3 npm CVEs found. xlsx@0.18.5 has two HIGH issues (GHSA-4r6h-8v6p-xvw6 prototype pollution; GHSA-5pgg-2g8v-p4x9 ReDoS). ai@5.0.0 has LOW issue (GHSA-rwvc-j5jr-mgvh, fixed in 5.0.52).


📦 Dependency Vulnerabilities

🟠 NPM Packages (HIGH)

Risk Score: 8/10 | Summary: 2 high, 1 low CVEs found

Package Version CVE Severity CVSS Summary Fixed In
xlsx 0.18.5 GHSA-4r6h-8v6p-xvw6 HIGH N/A Prototype Pollution in sheetJS No fix yet
xlsx 0.18.5 GHSA-5pgg-2g8v-p4x9 HIGH N/A SheetJS Regular Expression Denial of Service (ReDoS) No fix yet
ai 5.0.0 GHSA-rwvc-j5jr-mgvh LOW N/A Vercel’s AI SDK's filetype whitelists can be bypassed when uploading files 5.0.52

🛡️ Code Security Analysis

View 4 file(s) with issues

🔴 .github/workflows/auto-pr-to-main.yml (HIGH Risk)

# Issue Risk Level
1 Self-hosted runner may expose secrets if compromised HIGH
2 GITHUB_TOKEN passed to third-party action repo-sync can be abused HIGH
3 Workflow grants broad write permissions (contents,pull-requests,issues) HIGH
4 Push-triggered runs on feature/* execute branch code with repo write rights HIGH
5 continue-on-error may mask failures and hide errors HIGH

Recommendations:

  1. If you don't need a self-hosted runner, use GitHub-hosted runners (e.g., ubuntu-latest). If you must use a self-hosted runner, isolate it, restrict which repositories/secrets it can access, rotate secrets frequently, and audit the runner host regularly.
  2. Avoid passing GITHUB_TOKEN (or any repo-scoped token) to unpinned third-party actions. Pin actions to specific commit SHAs (e.g., repo-sync/pull-request@) and prefer verified actions. Consider using a dedicated bot token with minimal scopes stored in secrets if absolutely necessary, and scope it to only the required operations.
  3. Follow least-privilege: scope permissions at the workflow or step level to only what's required. If only creating a pull request is needed, limit to pull-requests: write and set contents: read (or remove contents write if not required). Prefer the top-level permissions block and tighten it (e.g., contents: read, issues: none).
  4. Do not run unreviewed branch code with write permissions on push. Consider triggering the PR-creation workflow from pull_request or from a protected branch merge, or use pull_request_target or a trusted workflow to perform sensitive write operations so untrusted code cannot run with elevated rights. Require branch protections and code review before merges.
  5. Remove continue-on-error at the job level or restrict it to specific non-sensitive steps. Ensure critical steps enforce success (use explicit if: ${{ success() }} checks) and fail the job when security-sensitive actions do not complete successfully.

🟡 apps/app/src/app/(app)/[orgId]/tasks/[taskId]/components/SingleTask.tsx (MEDIUM Risk)

# Issue Risk Level
1 Unsanitized inputs to server actions may enable SQL/command injection MEDIUM
2 Regenerate action invoked with client-provided taskId MEDIUM
3 Server errors shown to users via toast.error may leak sensitive info MEDIUM
4 URL param orgId used without validation (path/injection risk) MEDIUM
5 Comments may render user content unsafely (XSS risk) MEDIUM

Recommendations:

  1. Enforce strict server-side validation and authorization for all actions invoked from the client (e.g., updateTask, regenerateTaskAction). Never trust client-provided IDs—verify the caller is authorized to act on the given orgId/taskId.
  2. Use parameterized database queries / ORM protections on the server for any values originating from the client. Validate types, length, allowed characters, and ranges before using them in queries or commands.
  3. Do not display raw server error messages to end users. Return sanitized, user-friendly error messages to the client and log full details server-side with appropriate access controls. Example: map internal errors to safe client messages and store full stack/error details in server logs.
  4. Validate and normalize URL parameters (orgId, taskId) on the server and, where applicable, on the client. Use strict parsing/whitelisting (e.g., UUID pattern or numeric ID) and escape/encode parameters when interpolating into URLs (e.g., encodeURIComponent) or templates.
  5. Ensure comments (and any user-supplied rich text) are sanitized/escaped before rendering. Use a well-maintained library (DOMPurify, sanitize-html) for HTML inputs or render as text, and enforce Content Security Policy (CSP) to mitigate XSS.
  6. Audit actions imported from the actions directory (e.g., regenerateTaskAction, updateTask) to ensure they perform server-side validation, authorization checks, and safe DB access. Add unit/integration tests that simulate malicious inputs.
  7. Prefer returning minimal error codes from server actions and log detailed errors with correlation IDs so support can diagnose issues without leaking sensitive internals to users.

🟡 apps/app/src/app/(app)/[orgId]/tasks/[taskId]/components/TaskBody.tsx (MEDIUM Risk)

# Issue Risk Level
1 Opening unvalidated download URL via window.open MEDIUM
2 No client-side file type/MIME validation before upload MEDIUM
3 No server-side malware/virus check implied for uploads MEDIUM
4 No concurrency limit for multiple file uploads (DoS risk) MEDIUM
5 No limit on number of files selectable for upload MEDIUM
6 User file names used directly in toasts/UI (possible XSS) MEDIUM
7 Console.error exposes raw errors (info disclosure) MEDIUM

Recommendations:

  1. Validate download URLs before opening: ensure scheme is https/http, validate origin (or only allow same-origin paths returned by the API), and avoid opening attacker-controlled javascript: URLs. Prefer creating an with rel="noopener noreferrer" and target="_blank" or use window.open only after validating the URL and adding noopener behavior.
  2. Enforce server-side validation of file type (MIME and content sniffing) and size. Client-side checks are useful for UX but are not a substitute for server-side checks.
  3. Integrate server-side malware scanning for uploaded files (e.g., ClamAV, commercial scanning services) and normalize/sanitize filenames on the server. Store files with generated safe names and keep original name as metadata (after sanitization).
  4. Limit and throttle concurrent uploads on the client and server. Implement concurrency control (e.g., upload N files in parallel, queue the rest) and server rate-limiting to mitigate DoS from batch uploads.
  5. Limit the number of files selectable for upload (e.g., max attribute, or validate event.target.files.length and reject/ask the user) and enforce limits server-side as well.
  6. Sanitize/escape file names before passing them to UI and toast renderers. Treat file names as untrusted input: escape output, strip control characters, and avoid injecting unescaped HTML into toast APIs. If a toast library allows HTML content, disable that or sanitize with a library such as DOMPurify.
  7. Avoid logging raw server error payloads to the console in production. Log only necessary debugging info; redact sensitive fields. Use structured logging on the server and ensure client-side logging does not expose internal error stacks or sensitive data to end users.

🟢 apps/app/src/app/(app)/[orgId]/tasks/components/AutomationsSection.tsx (LOW Risk)

# Issue Risk Level
1 Unvalidated route params and IDs used directly in hrefs LOW
2 Missing validation of latestRun.createdAt before Date parsing LOW
3 Displaying untrusted strings without explicit length/encoding checks LOW

Recommendations:

  1. Encode URL path segments when building hrefs (e.g., use encodeURIComponent for orgId, automation.id, task.id) and validate these values server- and client-side. Add explicit checks for allowed characters and maximum length.
  2. Add runtime validation for props (Zod/TypeBox/io-ts or simple runtime checks). Ensure orgId and IDs match expected patterns (e.g., /^[a-zA-Z0-9_-]{1,64}$/) before using them to build routes.
  3. Validate latestRun.createdAt before calling new Date() / formatDistanceToNow. Check for null/undefined and that new Date(value) is a valid date (isFinite(date.getTime())).
  4. Enforce maximum length and sanitize/truncate displayed text fields (automation.name, task.title). Although React escapes strings by default (preventing raw HTML injection), long or control-character-containing values can break UI or be abused in other contexts—normalize and trim input on ingestion and before render.
  5. Add centralized input validation on server-side API that provides the automations list (ensure createdAt is a valid timestamp/ISO string or Date, IDs conform to expected formats, text fields are within allowed length).
  6. If any values are later used in contexts where React escaping does not apply (dangerouslySetInnerHTML, constructing class names, building HTML attributes), ensure encoding/sanitization appropriate to the context is applied.

💡 Recommendations

View 3 recommendation(s)
  1. Upgrade ai to >=5.0.52 to apply the GHSA-rwvc-j5jr-mgvh fix and run tests/verify behavior where the package is used.
  2. Upgrade or replace xlsx@0.18.5 to a release that patches GHSA-4r6h-8v6p-xvw6 and GHSA-5pgg-2g8v-p4x9. If no patched release is immediately available, remove or isolate code paths that parse untrusted Excel files until a fix is applied.
  3. Audit and harden all code that accepts or parses Excel/third‑party files: validate file type and size, treat file contents as untrusted (no direct prototype extension/assignment), and apply input limits/timeout protections to mitigate ReDoS and prototype pollution exploitation.

Powered by Comp AI - AI that handles compliance for you. Reviewed Nov 14, 2025

@Marfuen Marfuen merged commit 60dfb28 into main Nov 14, 2025
7 of 9 checks passed
@Marfuen Marfuen deleted the mariano/automation-improvements branch November 14, 2025 21:59
claudfuen pushed a commit that referenced this pull request Nov 17, 2025
# [1.59.0](v1.58.0...v1.59.0) (2025-11-17)

### Features

* **questionnaire:** add security questionnaire feature with AI parsing and auto-answering ([#1755](#1755)) ([dd4f86c](dd4f86c))
* **questionnaire:** enhance S3 client creation on parse action ([#1760](#1760)) ([4079b73](4079b73))
* **security-questionnaire:** add AI-powered questionnaire parsing an… ([#1751](#1751)) ([e06bb15](e06bb15))
* **security-questionnaire:** add support for questionnaire file uploads to S3 ([#1758](#1758)) ([1ba8866](1ba8866))
* **security-questionnaire:** add tooltip and disable CTA for unpublished policies ([#1761](#1761)) ([849966e](849966e))
* **tasks:** enhance task management with automation features and UI improvements ([#1752](#1752)) ([60dfb28](60dfb28))
* **trust-access:** implement trust access request management system ([#1739](#1739)) ([2ba3d5d](2ba3d5d))
@claudfuen
Copy link
Contributor

🎉 This PR is included in version 1.59.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants