ML algorithms, used in complex and sensitive problems, have raised concerns about privacy and security. Researchers have found that these algorithms can leak sensitive information through attacks. To understand and generalize these attacks, a new framework has been proposed. Previous research focused on data-dependent strategies for attacks, but this new framework takes a more general approach. The main idea is to study the connection between generalization, Differential Privacy (DP), attribute, and membership inference attacks. The study extends these results to different loss functions and considers a Bayesian attacker with white-box access. The article disproves the statement that generalization implies privacy by providing an example where the generalization gap tends to 0 while the attacker achieves perfect accuracy. The framework proposed in the article provides a way to model membership and/or attribute inference attacks in ML systems. It establishes universal bounds on the success rate of inference attacks, which can guide the design of privacy defense mechanisms. The research team investigates the connection between generalization and membership inference, finding that bad generalization can lead to privacy leaks. They also study the information stored by a trained model about its training set and its role in privacy attacks. Numerical experiments on linear regression and deep neural networks show the effectiveness of the proposed approach in assessing privacy risks. The experiments demonstrate the information leakage of ML models, and the team uses bounds to assess the success rate of attackers. If the lower bound is higher than random guessing, the model is considered to leak sensitive information. The research shows that models vulnerable to membership inference attacks are also vulnerable to other privacy violations. The success rate of the Bayesian attacker provides a strong guarantee of privacy, but computing the associated decision region is computationally infeasible. The team provides a synthetic example using linear regression and Gaussian data to calculate the involved distributions analytically. In conclusion, the use of ML algorithms has raised concerns about privacy and security. A new formalism has been proposed to understand inference attacks and their connection to generalization and memorization. Universal bounds on the success rate of attacks can guide privacy defense mechanisms. The experiments on linear regression and deep neural networks show the effectiveness of the proposed approach in assessing privacy risks. Continued efforts are needed to improve the privacy and security of ML models.