In all versions of GitLab CE/EE since version 13.6, it is possible to see pending invitations of any public group or public project by visiting an API endpoint.
https://hackerone.com/reports/1048259
https://gitlab.com/gitlab-org/gitlab/-/issues/290985
https://gitlab.com/gitlab-org/cves/-/blob/master/2021/CVE-2021-39875.json