-
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix: upgrade org.springframework.boot:spring-boot to 4.0.6, 3.5.14 (CVE-2026-40973) #3514
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
base: master
Are you sure you want to change the base?
Changes from all commits
5c38bd8
a330d82
a76f885
4929b68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,9 +40,9 @@ public class CommandServiceImpl implements CommandService { | |
| private Author getAuthorByUsername(String username) { | ||
| Author author; | ||
| try (var session = sessionFactory.openSession()) { | ||
| var query = session.createQuery("from Author where username=:username"); | ||
| var query = session.createQuery("from Author where username=:username", Author.class); | ||
| query.setParameter("username", username); | ||
| author = (Author) query.uniqueResult(); | ||
| author = query.uniqueResult(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the username is not unique, uniqueResult may throw NonUniqueResultException. Ensure username is unique at the DB level or switch to a safe retrieval strategy (e.g., getResultList and enforce single element). |
||
| } | ||
| if (author == null) { | ||
| HibernateUtil.getSessionFactory().close(); | ||
|
|
@@ -54,9 +54,9 @@ private Author getAuthorByUsername(String username) { | |
| private Book getBookByTitle(String title) { | ||
| Book book; | ||
| try (var session = sessionFactory.openSession()) { | ||
| var query = session.createQuery("from Book where title=:title"); | ||
| var query = session.createQuery("from Book where title=:title", Book.class); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar risk as above for fetching a Book by title. Ensure title column is unique or handle multiple results gracefully. |
||
| query.setParameter("title", title); | ||
| book = (Book) query.uniqueResult(); | ||
| book = query.uniqueResult(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Retrieving a single Book with uniqueResult can throw NonUniqueResultException if multiple books share the same title. Consider DB-level constraints or safer retrieval. |
||
| } | ||
| if (book == null) { | ||
| HibernateUtil.getSessionFactory().close(); | ||
|
|
@@ -70,7 +70,7 @@ public void authorCreated(String username, String name, String email) { | |
| var author = new Author(username, name, email); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.save(author); | ||
| session.persist(author); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -81,7 +81,7 @@ public void bookAddedToAuthor(String title, double price, String username) { | |
| var book = new Book(title, price, author); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.save(book); | ||
| session.persist(book); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -92,7 +92,7 @@ public void authorNameUpdated(String username, String name) { | |
| author.setName(name); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.update(author); | ||
| session.merge(author); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -103,7 +103,7 @@ public void authorUsernameUpdated(String oldUsername, String newUsername) { | |
| author.setUsername(newUsername); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.update(author); | ||
| session.merge(author); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -114,7 +114,7 @@ public void authorEmailUpdated(String username, String email) { | |
| author.setEmail(email); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.update(author); | ||
| session.merge(author); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -125,7 +125,7 @@ public void bookTitleUpdated(String oldTitle, String newTitle) { | |
| book.setTitle(newTitle); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.update(book); | ||
| session.merge(book); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
@@ -136,7 +136,7 @@ public void bookPriceUpdated(String title, double price) { | |
| book.setPrice(price); | ||
| try (var session = sessionFactory.openSession()) { | ||
| session.beginTransaction(); | ||
| session.update(book); | ||
| session.merge(book); | ||
| session.getTransaction().commit(); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential NonUniqueResultException if username is not unique; consider enforcing a unique constraint on the username column and/or handling NonUniqueResultException to avoid runtime failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orbisai0security can you address code review comments?