📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Potential fix for pull request finding 'CodeQL / Loop bound injection'
Andrii Romasiunb15957d57f71
diff --git a/backend/apps/community/src/project/project.controller.ts b/backend/apps/community/src/project/project.controller.tsindex 07c4bdea2..7b98910e4 100644--- a/backend/apps/community/src/project/project.controller.ts+++ b/backend/apps/community/src/project/project.controller.ts@@ -1073,9 +1073,22 @@ export class ProjectController {}if (projectDTO.countryBlacklist !== undefined) {- project.countryBlacklist = projectDTO.countryBlacklist- ? (_map(projectDTO.countryBlacklist, _trim) as string[])- : []+ if (projectDTO.countryBlacklist) {+ if (!Array.isArray(projectDTO.countryBlacklist)) {+ throw new BadRequestException('countryBlacklist must be an array')+ }++ if (projectDTO.countryBlacklist.length > 1000) {+ throw new BadRequestException('countryBlacklist is too large')+ }++ project.countryBlacklist = _map(+ projectDTO.countryBlacklist,+ _trim,+ ) as string[]+ } else {+ project.countryBlacklist = []+ }}if (projectDTO.botsProtectionLevel) {