-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f0c65d
commit 6a7fd9f
Showing
4 changed files
with
32 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import pathlib | ||
import textwrap | ||
from dataclasses import dataclass | ||
|
||
import aiofiles | ||
|
@@ -11,13 +12,23 @@ | |
class JHipsterVulnerabilityFixModule(VulnerabilityFixModule): | ||
branch_name: str = 'fix/JLL/jhipster_insecure_rng_vulnerability' | ||
clone_repos_location: str = 'cloned_repos' | ||
data_base_dir = 'insecure_jhipster_rng_data' | ||
save_point_location: str = 'save_points' | ||
pr_message_file_absolute_path: str = f'{str(pathlib.Path().absolute())}/PR_MESSAGE.md' | ||
data_base_dir: str = 'jhipster_rng_vulnerability/data' | ||
save_point_location: str = 'jhipster_rng_vulnerability/save_points' | ||
pr_message_file_absolute_path: str = f'{str(pathlib.Path().absolute())}/jhipster_rng_vulnerability/PR_MESSAGE.md' | ||
commit_message: str = textwrap.dedent('''\ | ||
CVE-2019-16303 - JHipster Vulnerability Fix - Use CSPRNG in RandomUtil | ||
This fixes a security vulnerability in this project where the `RandomUtil.java` | ||
file(s) were using an insecure Pseudo Random Number Generator (PRNG) instead of | ||
a Cryptographically Secure Pseudo Random Number Generator (CSPRNG) for | ||
security sensitive data. | ||
Signed-off-by: Jonathan Leitschuh <[email protected]> | ||
''') | ||
post_url = 'https://us-central1-glassy-archway-286320.cloudfunctions.net/cwe338' | ||
session = AsyncSession(n=100) | ||
|
||
def do_fix_vulnerable_file(self, project_name: str, file: str, expected_fix_count: int) -> int: | ||
async def do_fix_vulnerable_file(self, project_name: str, file: str, expected_fix_count: int) -> int: | ||
async with aiofiles.open(file, newline='') as vulnerableFile: | ||
contents: str = await vulnerableFile.read() | ||
# noinspection PyUnresolvedReferences | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters