Skip to content

Commit

Permalink
fix: some security vulnerabilities (#4143)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonfournier and Christopher Kolstad committed Jul 5, 2023
1 parent 8707c2f commit 661cbf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/notify_enterprise.yaml
Expand Up @@ -24,12 +24,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: |
echo "github.event.head_commit.committer.name: ${{ github.event.head_commit.committer.name }}"
echo "github.event.head_commit.committer.email: ${{ github.event.head_commit.committer.email }}"
echo "github.actor: ${{ github.actor }}"
echo "github.event.commits[0].author.name ${{ github.event.commits[0].author.name }}"
echo "github.event.commits[0].author.email ${{ github.event.commits[0].author.email }}"
- name: Trigger sync
uses: actions/github-script@v6
with:
Expand Down
8 changes: 8 additions & 0 deletions src/lib/util/is-email.ts
Expand Up @@ -5,11 +5,19 @@ const matcher =

/**
* Loosely validate an email address.
* Max length of an email address is 320 characters: 64 for the local part + 1 for the @ +
* 255 for the domain part.
* See https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1.1
*
* Being a bit extra cautious here and limiting the max length to 500 characters, which prevents
* [Regular expression Denial of Service - ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) attacks
* due to polynomial regular expression used on uncontrolled data.
*
* @param {string} string
* @return {boolean}
*/
function isEmail(value: string): boolean {
if (value.length > 500) return false;
return matcher.test(value);
}

Expand Down

0 comments on commit 661cbf2

Please sign in to comment.