Critical · published March 24, 2023
🔥 A sneaky change in Angular's version 15.0.0 could expose sensitive backend environment variables in your application's index.html! Think of this like a restaurant where the chefs accidentally put the secret sauce recipe on the menu. Instead of keeping it hidden for staff only, it gets shown to every customer. In a monorepo, the wider search now risks revealing private backend info meant to stay under wraps. This vulnerability could lead to critical data exposure, allowing anyone who loads your application to see sensitive backend environment variables. If an attacker gets access to this data, it could lead to unauthorized access to your services or even complete control over your deployment!
Think of this like a restaurant where the chefs accidentally put the secret sauce recipe on the menu. Instead of keeping it hidden for staff only, it gets shown to every customer. In a monorepo, the wider search now risks revealing private backend info meant to stay under wraps. In Angular version 15.0.0, environment variable detection expanded its search scope, inadvertently allowing backend service variables to be written to ngssc.json and exposed in the index.html during deployment. This was addressed in version 15.1.0 by introducing a new option, "searchPattern," to limit what variables are detected.
This vulnerability could lead to critical data exposure, allowing anyone who loads your application to see sensitive backend environment variables. If an attacker gets access to this data, it could lead to unauthorized access to your services or even complete control over your deployment! Upgrade your Angular project to version 15.1.0 or later to mitigate this vulnerability. Additionally, manually edit or create the ngssc.json file to ensure that no sensitive data leaks through. Consider running a script post-generation to double-check any sensitive information is filtered out! You've got this! Stay proactive and secure your application with these steps to protect your data! 🛡️