mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
wkd: Fix path traversal attack on gpg-wks-server.
* tools/gpg-wks-server.c (check_and_publish): Check for invalid characters in sender controlled data. * tools/wks-util.c (wks_fname_from_userid): Ditto. (wks_compute_hu_fname): Ditto. (ensure_policy_file): Ditto.
This commit is contained in:
parent
8c9f879d4a
commit
c1489ca0e1
2 changed files with 25 additions and 0 deletions
|
@ -1378,6 +1378,15 @@ check_and_publish (server_ctx_t ctx, const char *address, const char *nonce)
|
|||
domain = strchr (address, '@');
|
||||
log_assert (domain && domain[1]);
|
||||
domain++;
|
||||
if (strchr (domain, '/') || strchr (domain, '\\')
|
||||
|| strchr (nonce, '/') || strchr (nonce, '\\'))
|
||||
{
|
||||
log_info ("invalid domain or nonce received ('%s', '%s')\n",
|
||||
domain, nonce);
|
||||
err = gpg_error (GPG_ERR_NOT_FOUND);
|
||||
goto leave;
|
||||
}
|
||||
|
||||
fname = make_filename_try (opt.directory, domain, "pending", nonce, NULL);
|
||||
if (!fname)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue