Skip to content

[Snyk] Security upgrade typeorm from 0.2.24 to 0.3.31 - #344

Open
nirw-snyk wants to merge 2 commits into
mainfrom
snyk-fix-12531f5406894b05680ad3780e05c51f
Open

[Snyk] Security upgrade typeorm from 0.2.24 to 0.3.31#344
nirw-snyk wants to merge 2 commits into
mainfrom
snyk-fix-12531f5406894b05680ad3780e05c51f

Conversation

@nirw-snyk

Copy link
Copy Markdown
Owner

snyk-top-banner

Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.

Snyk changed the following file(s):

  • package.json
  • package-lock.json

Vulnerabilities that will be fixed with an upgrade:

Issue Score
high severity Arbitrary Code Injection
SNYK-JS-TYPEORM-18170276
  758  

Breaking Change Risk

Merge Risk: High

Notice: This assessment is enhanced by AI.


Important

  • Check the changes in this PR to ensure they won't cause issues with your project.
  • Max score is 1000. Note that the real score may have changed since the PR was raised.
  • This PR was automatically created by Snyk using the credentials of a real user.

Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.

For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic


Learn how to fix vulnerabilities with free interactive lessons:

🦉 Arbitrary Code Injection

@nirw-snyk

Copy link
Copy Markdown
Owner Author

Merge Risk: High

This is a major version upgrade from 0.2.x to 0.3.x that includes numerous significant and breaking changes, requiring substantial code refactoring.

Key Breaking Changes:

  • DataSource API: createConnection() and the Connection class are deprecated. You must migrate to the new DataSource API for establishing and managing database connections. Configuration files like ormconfig.js are also deprecated in favor of a DataSource instance.
  • findOne Method Signature: The findOne(id) and findOneOrFail(id) method signatures have been removed. You must now use the object-based where clause, for example: repository.findOne({ where: { id: 1 } }).
  • Node.js Requirement: The package now requires Node.js 14 or higher, as the compilation target has been updated.
  • Repository Access: Methods like getRepository() and getManager() are deprecated. You should access repositories directly from your DataSource instance (e.g., dataSource.getRepository(User)).
  • CLI Commands: The CLI has been updated to work with the new DataSource configuration, typically requiring a -d flag to specify the path to your data source file.

Source: Official Changelog

Recommendation: This upgrade cannot be completed without significant manual intervention. Developers must follow a migration guide, refactor all database connection logic to use the DataSource API, and update all instances of findOne(id) and other deprecated methods. Thorough testing of all database interactions is critical.

Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.

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