Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Fix All Security Warnings - COMPLETED ✅

All security vulnerabilities resolved with minimal resolutions!

Production Dependencies Upgraded:

  • axios: 1.6.0 → 1.13.2 (DoS vulnerability GHSA-4hjh-wcwx-xvwj)
  • style-dictionary: 3.9.0 → 3.9.2 (latest 3.x with security fixes)

Development Dependencies Upgraded:

  • jest: 29.7.0 → 30.2.0 (brings updated transitive deps)
  • @types/jest: 29.5.7 → 30.0.0
  • ts-jest: 29.1.1 → 29.4.5
  • eslint: 8.52.0 → 8.57.1
  • @typescript-eslint/eslint-plugin: 6.9.1 → 8.46.4 (requires Node >=18.18.0)
  • @typescript-eslint/parser: 6.9.1 → 8.46.4
  • eslint-plugin-jest: 27.6.0 → 28.10.0
  • eslint-plugin-import: 2.29.0 → 2.32.0
  • ts-patch: 3.0.2 → 3.3.0

Node.js Version Update:

  • Node.js: 16.5.0 → 20.9.0 (required to support upgraded @typescript-eslint packages which need Node >=18.18.0)

Minimal Resolutions (only 1 needed!):

  • axios: 1.13.2 (documented in resolutionsComments: figma-api@1.11.0 depends on vulnerable axios@^0.21.1; resolution ensures all dependencies use secure version)

All Security Issues Resolved via Package Upgrades:

  • ✅ @babel/helpers, @babel/traverse (via jest 30.x)
  • ✅ braces, micromatch, tar (via jest 30.x)
  • ✅ cross-spawn, brace-expansion (via eslint 8.57.1)
  • ✅ follow-redirects (via axios 1.13.2)
  • ✅ http-cache-semantics, semver (via jest 30.x)
  • ✅ json5 (via style-dictionary 3.9.2 + jest 30.x)
  • ✅ ip/socks (via jest 30.x)

Validation:

  • yarn npm audit ✅ No vulnerabilities!
  • yarn build ✅ All 34 test suites passed (151 tests)
  • CI checks passing with updated Node.js version

Summary

Reduced resolutions from 6 to just 1 by upgrading packages to their latest compatible versions. Updated Node.js from 16.5.0 to 20.9.0 to support the newer @typescript-eslint packages. Resolution explanation documented directly in package.json via resolutionsComments field.

View original Slack conversation

View original Slack conversation


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: neil-armstrong-instil <14013708+neil-armstrong-instil@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix all security warnings in Figma Sync Fix all security vulnerabilities in dependencies Nov 10, 2025
package.json Outdated
"micromatch": "4.0.8",
"semver": "7.5.4",
"socks": "2.8.7",
"tar": "6.2.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you do this upgrade directly to the libraries rather than resolutions like this? The tests should hopefully catch any issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to upgrade devDependencies directly:

  • jest: 29.7.0 → 30.2.0
  • eslint: 8.52.0 → 8.57.1
  • @typescript-eslint packages: 6.9.1 → 8.46.4
  • ts-jest: 29.1.1 → 29.4.5
  • @types/jest: 29.5.7 → 30.0.0
  • eslint-plugin-jest: 27.6.0 → 28.10.0

This naturally brings in secure versions of transitive dependencies (braces, cross-spawn, micromatch, tar, etc.) without needing individual resolutions. Only keeping minimal resolutions for axios and follow-redirects where needed.

All tests pass and yarn audit reports no vulnerabilities. (6cba278)

Co-authored-by: neil-armstrong-instil <14013708+neil-armstrong-instil@users.noreply.github.com>
package.json Outdated
"semver": "7.5.4",
"socks": "2.8.7",
"tar": "6.2.1"
"semver": "7.5.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot are you able to upgrade package versions to remove all of these resolutions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all resolutions except one! Updated packages:

  • style-dictionary: 3.9.0 → 3.9.2
  • eslint-plugin-import: 2.29.0 → 2.32.0
  • ts-patch: 3.0.2 → 3.3.0

Only keeping axios: 1.13.2 resolution to ensure consistency across all dependencies (including the figma-api transitive dependency which pulls in vulnerable axios 0.21.4).

All other security issues are now resolved through the upgraded parent packages. yarn audit reports no vulnerabilities and all tests pass. (9011b16)

Co-authored-by: neil-armstrong-instil <14013708+neil-armstrong-instil@users.noreply.github.com>
"http-cache-semantics": "4.1.1",
"json5": "2.2.3",
"semver": "7.5.4"
"axios": "1.13.2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot why is this resolution still required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The axios resolution is needed because figma-api@1.11.0 depends on axios: ^0.21.1, which resolves to the vulnerable version 0.21.4.

The latest stable version of figma-api (1.12.0) still uses axios: ^0.27.2 (also vulnerable). The beta version (2.1.0-beta) uses axios: ^1.12.2, but it's a major rewrite with breaking API changes.

Without this resolution, the vulnerable axios 0.21.4 would be installed for figma-api, failing the security audit. The resolution ensures all axios dependencies use the secure 1.13.2 version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot can you delete the dependecy-override.md file, and then instead add a ```
"resolutionsComments": {
"axios": "some explaination here"
}

That explains this in a single short sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted dependency-overrides.md and added resolutionsComments field to package.json with a concise explanation. (2151f22)

Co-authored-by: neil-armstrong-instil <14013708+neil-armstrong-instil@users.noreply.github.com>
@neil-armstrong-instil neil-armstrong-instil marked this pull request as ready for review November 10, 2025 21:07
@neil-armstrong-instil
Copy link
Collaborator

@copilot fix the failing commitChecks action

Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot fix the failing commitChecks action

All checks pass locally (yarn build completes successfully with all 34 test suites passing and no linting errors). The package.json is valid JSON and yarn install/build work correctly. If the CI is still failing, it may be due to a cached node_modules or environment issue. Please try re-running the workflow or clearing the GitHub Actions cache.

@neil-armstrong-instil
Copy link
Collaborator

@copilot the github action failed with this error, the cache was cleared before rerunning it

TypeError: Failed to load plugin '@typescript-eslint' declared in '.eslintrc.json': Object.hasOwn is not a function
Referenced from: /home/runner/work/figma-sync/figma-sync/.eslintrc.json
    at Object.unionWith (/home/runner/work/figma-sync/figma-sync/node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs:378:20)
    at Object.<anonymous> (/home/runner/work/figma-sync/figma-sync/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.js:194:41)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/home/runner/work/figma-sync/figma-sync/node_modules/@typescript-eslint/visitor-keys/dist/index.js:6:22)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)

Co-authored-by: neil-armstrong-instil <14013708+neil-armstrong-instil@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot the github action failed with this error, the cache was cleared before rerunning it

...

Fixed! The error was caused by Node 16.5.0 not supporting Object.hasOwn, which the upgraded @typescript-eslint packages require. Updated .node-version from 16.5.0 to 20.9.0 to meet the minimum requirement (Node >=18.18.0) for @typescript-eslint@8.46.4. (72d41e5)

@neil-armstrong-instil neil-armstrong-instil merged commit 4c8e7a6 into main Nov 10, 2025
4 checks passed
@neil-armstrong-instil neil-armstrong-instil deleted the copilot/fix-security-warnings branch November 10, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants