-
Notifications
You must be signed in to change notification settings - Fork 178
Clear password from memory #2743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2033,6 +2033,8 @@ send_to_sourcefire (const char *ip, const char *port, const char *pkcs12_64, | |
|
|
||
| if (!gvm_file_is_readable (script)) | ||
| { | ||
| memset (clean_password, 0, strlen (clean_password)); | ||
|
|
||
| g_free (report_file); | ||
| g_free (pkcs12_file); | ||
| g_free (clean_password); | ||
|
|
@@ -2054,6 +2056,9 @@ send_to_sourcefire (const char *ip, const char *port, const char *pkcs12_64, | |
| g_warning ("%s: Failed to getcwd: %s", | ||
| __func__, | ||
| strerror (errno)); | ||
|
|
||
| memset (clean_password, 0, strlen (clean_password)); | ||
|
|
||
| g_free (report_file); | ||
| g_free (pkcs12_file); | ||
| g_free (clean_password); | ||
|
|
@@ -2068,6 +2073,9 @@ send_to_sourcefire (const char *ip, const char *port, const char *pkcs12_64, | |
| g_warning ("%s: Failed to chdir: %s", | ||
| __func__, | ||
| strerror (errno)); | ||
|
|
||
| memset (clean_password, 0, strlen (clean_password)); | ||
|
|
||
| g_free (report_file); | ||
| g_free (pkcs12_file); | ||
| g_free (clean_password); | ||
|
|
@@ -2091,6 +2099,10 @@ send_to_sourcefire (const char *ip, const char *port, const char *pkcs12_64, | |
| pkcs12_file, | ||
| report_file, | ||
| clean_password); | ||
|
|
||
|
|
||
| memset (clean_password, 0, strlen (clean_password)); | ||
|
|
||
| g_free (script); | ||
| g_free (clean_ip); | ||
| g_free (clean_port); | ||
|
|
@@ -2423,6 +2435,9 @@ send_to_verinice (const char *url, const char *username, const char *password, | |
| clean_url, | ||
| clean_username, | ||
| archive_file); | ||
|
|
||
| memset (clean_password, 0, strlen (clean_password)); | ||
|
|
||
| g_free (script); | ||
| g_free (clean_url); | ||
| g_free (clean_username); | ||
|
|
@@ -4402,6 +4417,9 @@ trigger_to_vfire (alert_t alert, task_t task, report_t report, event_t event, | |
| get_data_reset (alert_filter_get); | ||
| g_free (alert_filter_get); | ||
| } | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| free (base_url); | ||
| free (session_type); | ||
| free (client_id); | ||
|
|
@@ -4938,6 +4956,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| message, strlen (message), | ||
| script_message); | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
|
||
| g_free (message); | ||
| free (private_key); | ||
| free (password); | ||
|
|
@@ -5005,6 +5025,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| report_content, content_length, | ||
| script_message); | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
|
||
| free (private_key); | ||
| free (password); | ||
| free (username); | ||
|
|
@@ -5215,6 +5237,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| max_protocol, report_content, content_length, | ||
| script_message); | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
|
||
| g_free (username); | ||
| g_free (password); | ||
| free (credential_id); | ||
|
|
@@ -5377,6 +5401,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| ret = send_to_sourcefire (ip, port, pkcs12, pkcs12_password, | ||
| report_content); | ||
|
|
||
| memset (pkcs12_password, 0, strlen (pkcs12_password)); | ||
|
|
||
| free (ip); | ||
| g_free (port); | ||
| free (pkcs12); | ||
|
|
@@ -5486,6 +5512,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| g_free (extension); | ||
| if (ret) | ||
| { | ||
| memset (password, 0, strlen (password)); | ||
|
|
||
| g_free (username); | ||
| g_free (password); | ||
| g_free (hostname); | ||
|
|
@@ -5499,6 +5527,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| certificate, tls_cert_workaround, | ||
| script_message); | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
|
||
| g_free (username); | ||
| g_free (password); | ||
| g_free (hostname); | ||
|
|
@@ -5577,6 +5607,8 @@ trigger (alert_t alert, task_t task, report_t report, event_t event, | |
| ret = send_to_verinice (url, username, password, report_content, | ||
| content_length); | ||
|
|
||
| memset (password, 0, strlen (password)); | ||
|
|
||
| free (url); | ||
| g_free (username); | ||
| g_free (password); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -268,7 +268,7 @@ set_auth_data_ssh_from_credential_store (iterator_t *iter, | |||||
| = credential_iterator_host_identifier (iter); | ||||||
|
|
||||||
| if (cyberark_login_password_credential_data (cred_store_uuid, | ||||||
| vault_id, | ||||||
| vault_id,gm | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| host_identifier, | ||||||
| &login, | ||||||
| &password)) | ||||||
|
|
@@ -307,6 +307,8 @@ set_auth_data_ssh_from_credential_store (iterator_t *iter, | |||||
| password); | ||||||
| } | ||||||
|
|
||||||
| memset (password, 0, strlen (password)); | ||||||
|
|
||||||
| g_free (login); | ||||||
| g_free (password); | ||||||
| return 0; | ||||||
|
|
@@ -390,6 +392,8 @@ set_auth_data_up_from_credential_store (iterator_t *iter, | |||||
| osp_credential_set_auth_data (osp_credential, "username", login); | ||||||
| osp_credential_set_auth_data (osp_credential, "password", password); | ||||||
|
|
||||||
| memset (password, 0, strlen (password)); | ||||||
|
|
||||||
| g_free (login); | ||||||
| g_free (password); | ||||||
| return 0; | ||||||
|
|
@@ -440,6 +444,9 @@ set_auth_data_snmp_from_credential_store (iterator_t *iter, | |||||
| g_debug ("%s: Error retrieving SNMP privacy password from" | ||||||
| " CyberArk credential store '%s'.", | ||||||
| __func__, cred_store_uuid); | ||||||
|
|
||||||
| password (password, 0, strlen (password)); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did you mean memset? |
||||||
|
|
||||||
| g_free (login); | ||||||
| g_free (password); | ||||||
| g_free (privacy_password); | ||||||
|
|
@@ -451,6 +458,9 @@ set_auth_data_snmp_from_credential_store (iterator_t *iter, | |||||
| osp_credential_set_auth_data (osp_credential, "privacy_password", | ||||||
| privacy_password); | ||||||
|
|
||||||
| memset(password, 0, strlen (password)); | ||||||
| memset(privacy_password, 0, strlen (privacy_password)); | ||||||
|
|
||||||
| g_free (login); | ||||||
| g_free (password); | ||||||
| g_free (privacy_password); | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strlen should be on same field.