GNU bug report logs - #65973
[PATCH] ; send filename, not full path, on EWW form submit

Previous Next

Package: emacs;

Reported by: daniel watson <ozzloy <at> challenge-bot.com>

Date: Thu, 14 Sep 2023 07:48:01 UTC

Severity: normal

Tags: patch

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65973 in the body.
You can then email your comments to 65973 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Thu, 14 Sep 2023 07:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to daniel watson <ozzloy <at> challenge-bot.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 14 Sep 2023 07:48:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: daniel watson <ozzloy <at> challenge-bot.com>
To: bug-gnu-emacs <at> gnu.org
Cc: daniel watson <ozzloy <at> gmail.com>
Subject: [PATCH] ; send filename, not full path, on EWW form submit
Date: Wed, 13 Sep 2023 23:10:11 -0700
[Message part 1 (text/plain, inline)]
0. in one terminal, run this http server
   https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py
1. in another terminal, run
   socat -v tcp-listen:8086,fork tcp:localhost:8085
2. browse to the page with EWW,
   M-x eww <ENTER> localhost:8086 <ENTER>
3. put the cursor on the word "Browse" <ENTER>
4. select any file to which you have read access for uploading
5. put cursor on "Submit" <ENTER>
6. observe the full path of the file is sent to the server.  this is
   visible in both the python output and the socat output.

i'm including the diff inline to make it easier to review without
downloading the attached file.

---
 lisp/net/eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 4ddda216afc..f28273dcc58 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -1849,7 +1849,7 @@ eww-submit
                                   (insert-file-contents file)
                                   (buffer-string)))
                           (cons "name" name)
-                          (cons "filename" file))
+                          (cons "filename" (file-name-nondirectory file)))
                     values)))
 	   ((equal (plist-get input :type) "submit")
 	    ;; We want the values from buttons if we hit a button if
-- 
2.39.2




In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
 cairo version 1.16.0) of 2023-08-03 built on bos03-amd64-031
Repository revision: cf57ec68c2a5ac5b721f445928869ca14232a4d1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Ubuntu 23.04

Configured using:
 'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
 --without-xaw3d --with-modules --with-cairo
 --with-native-compilation=aot --with-xinput2 --with-tree-sitter
 --with-json
 'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include -O2'
 'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
 -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
 -isystem/build/emacs/stage/usr/include'
 'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
 -L/build/emacs/parts/emacs/install/usr/lib
 -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
 -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
 -L/build/emacs/stage/usr/lib''


[0001-send-filename-not-full-path-on-EWW-form-submit.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Fri, 15 Sep 2023 11:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: daniel watson <ozzloy <at> challenge-bot.com>
Cc: 65973 <at> debbugs.gnu.org, daniel watson <ozzloy <at> gmail.com>
Subject: Re: bug#65973: [PATCH] ;
 send filename, not full path, on EWW form submit
Date: Fri, 15 Sep 2023 04:47:08 -0700
daniel watson <ozzloy <at> challenge-bot.com> writes:

> i'm including the diff inline to make it easier to review without
> downloading the attached file.

Most (or all?) people reviewing patches use Emacs mail readers, so we
have no trouble reviewing attached files.  Getting it as an attachment
actually makes things easier for us, as our tools are adapted to that
workflow.  That's the main reason why we have a preference for that
format.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Tue, 19 Sep 2023 09:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: daniel watson <ozzloy <at> each.do>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 65973 <at> debbugs.gnu.org, daniel watson <ozzloy <at> gmail.com>
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Tue, 19 Sep 2023 00:15:45 -0700
On Fri, Sep 15, 2023 at 04:47:08AM -0700, Stefan Kangas wrote:
> Most (or all?) people reviewing patches use Emacs mail readers, so we
> have no trouble reviewing attached files.  Getting it as an attachment
> actually makes things easier for us, as our tools are adapted to that
> workflow.  That's the main reason why we have a preference for that
> format.

that makes sense.  i want to get my email setup like that.

the inline patch was included for easier viewing in the browser and not
as a replacement for the attachment, or endorsing skipping the
attachment.  so i'm glad you clarified

on the last bug report, when i got help from people, i found myself
linking to both the bug report page, and separately to another page
where they could view the code in-browser.  maybe the bug report page
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65973
could display the attached patch in addition to having a download link.
the source code for this page has not been touched in years though, so
that makes me think it will be difficult to contribute a change.

thanks for the assistance with this and the prior bug!





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Sat, 02 Dec 2023 15:04:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ozzloy <ozzloy <at> gmail.com>
To: daniel watson <ozzloy <at> challenge-bot.com>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: [PATCH] ; send filename, not full path, on EWW form submit
Date: Sat, 2 Dec 2023 07:02:20 -0800
[Message part 1 (text/plain, inline)]
bump

On Wed, Sep 13, 2023 at 11:10 PM daniel watson <ozzloy <at> challenge-bot.com>
wrote:

>
> 0. in one terminal, run this http server
>    https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py
> 1. in another terminal, run
>    socat -v tcp-listen:8086,fork tcp:localhost:8085
> 2. browse to the page with EWW,
>    M-x eww <ENTER> localhost:8086 <ENTER>
> 3. put the cursor on the word "Browse" <ENTER>
> 4. select any file to which you have read access for uploading
> 5. put cursor on "Submit" <ENTER>
> 6. observe the full path of the file is sent to the server.  this is
>    visible in both the python output and the socat output.
>
> i'm including the diff inline to make it easier to review without
> downloading the attached file.
>
> ---
>  lisp/net/eww.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/net/eww.el b/lisp/net/eww.el
> index 4ddda216afc..f28273dcc58 100644
> --- a/lisp/net/eww.el
> +++ b/lisp/net/eww.el
> @@ -1849,7 +1849,7 @@ eww-submit
>                                    (insert-file-contents file)
>                                    (buffer-string)))
>                            (cons "name" name)
> -                          (cons "filename" file))
> +                          (cons "filename" (file-name-nondirectory file)))
>                      values)))
>            ((equal (plist-get input :type) "submit")
>             ;; We want the values from buttons if we hit a button if
> --
> 2.39.2
>
>
>
>
> In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
>  cairo version 1.16.0) of 2023-08-03 built on bos03-amd64-031
> Repository revision: cf57ec68c2a5ac5b721f445928869ca14232a4d1
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
> System Description: Ubuntu 23.04
>
> Configured using:
>  'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
>  --without-xaw3d --with-modules --with-cairo
>  --with-native-compilation=aot --with-xinput2 --with-tree-sitter
>  --with-json
>  'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
>  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
>  -isystem/build/emacs/stage/usr/include -O2'
>  'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
>  -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
>  -isystem/build/emacs/stage/usr/include'
>  'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
>  -L/build/emacs/parts/emacs/install/usr/lib
>  -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
>  -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
>  -L/build/emacs/stage/usr/lib''
>
>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Tue, 05 Nov 2024 14:35:01 GMT) Full text and rfc822 format available.

Message #17 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: ozzloy <ozzloy <at> gmail.com>, Jim Porter <jporterbugs <at> gmail.com>
Cc: daniel watson <ozzloy <at> challenge-bot.com>, 65973 <at> debbugs.gnu.org
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Tue, 05 Nov 2024 09:34:46 -0500
/added Jim for visibility/

This seems like something simple enough to merge.
Thoughts?

ozzloy <ozzloy <at> gmail.com> writes:
>  bump
>
>  On Wed, Sep 13, 2023 at 11:10 PM daniel watson <ozzloy <at> challenge-bot.com> wrote:
>
>  0. in one terminal, run this http server
>     https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py
>  1. in another terminal, run
>     socat -v tcp-listen:8086,fork tcp:localhost:8085
>  2. browse to the page with EWW,
>     M-x eww <ENTER> localhost:8086 <ENTER>
>  3. put the cursor on the word "Browse" <ENTER>
>  4. select any file to which you have read access for uploading
>  5. put cursor on "Submit" <ENTER>
>  6. observe the full path of the file is sent to the server.  this is
>     visible in both the python output and the socat output.
>
>  i'm including the diff inline to make it easier to review without
>  downloading the attached file.
>
>  ---
>   lisp/net/eww.el | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
>  diff --git a/lisp/net/eww.el b/lisp/net/eww.el
>  index 4ddda216afc..f28273dcc58 100644
>  --- a/lisp/net/eww.el
>  +++ b/lisp/net/eww.el
>  @@ -1849,7 +1849,7 @@ eww-submit
>                                     (insert-file-contents file)
>                                     (buffer-string)))
>                             (cons "name" name)
>  -                          (cons "filename" file))
>  +                          (cons "filename" (file-name-nondirectory file)))
>                       values)))
>             ((equal (plist-get input :type) "submit")
>              ;; We want the values from buttons if we hit a button if
>  -- 
>  2.39.2
>
>  In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20,
>   cairo version 1.16.0) of 2023-08-03 built on bos03-amd64-031
>  Repository revision: cf57ec68c2a5ac5b721f445928869ca14232a4d1
>  Repository branch: master
>  Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
>  System Description: Ubuntu 23.04
>
>  Configured using:
>   'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
>   --without-xaw3d --with-modules --with-cairo
>   --with-native-compilation=aot --with-xinput2 --with-tree-sitter
>   --with-json
>   'CFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
>   -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
>   -isystem/build/emacs/stage/usr/include -O2'
>   'CPPFLAGS=-isystem/build/emacs/parts/emacs/install/usr/include
>   -isystem/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu
>   -isystem/build/emacs/stage/usr/include'
>   'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
>   -L/build/emacs/parts/emacs/install/usr/lib
>   -L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
>   -L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
>   -L/build/emacs/stage/usr/lib''
>

-- 
Sebastián Monía
https://site.sebasmonia.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Tue, 05 Nov 2024 17:09:02 GMT) Full text and rfc822 format available.

Message #20 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: jporterbugs <at> gmail.com, ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org,
 ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ;
 send filename, not full path, on EWW form submit
Date: Tue, 05 Nov 2024 19:08:02 +0200
> Cc: daniel watson <ozzloy <at> challenge-bot.com>, 65973 <at> debbugs.gnu.org
> From: Sebastián Monía
>  <sebastian <at> sebasmonia.com>
> Date: Tue, 05 Nov 2024 09:34:46 -0500
> 
> 
> /added Jim for visibility/
> 
> This seems like something simple enough to merge.
> Thoughts?
> 
> ozzloy <ozzloy <at> gmail.com> writes:
> >  bump
> >
> >  On Wed, Sep 13, 2023 at 11:10 PM daniel watson <ozzloy <at> challenge-bot.com> wrote:
> >
> >  0. in one terminal, run this http server
> >     https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py
> >  1. in another terminal, run
> >     socat -v tcp-listen:8086,fork tcp:localhost:8085
> >  2. browse to the page with EWW,
> >     M-x eww <ENTER> localhost:8086 <ENTER>
> >  3. put the cursor on the word "Browse" <ENTER>
> >  4. select any file to which you have read access for uploading
> >  5. put cursor on "Submit" <ENTER>
> >  6. observe the full path of the file is sent to the server.  this is
> >     visible in both the python output and the socat output.
> >
> >  i'm including the diff inline to make it easier to review without
> >  downloading the attached file.

I'd like some rationale for this change.  The original report never
explains why sending the full absolute file name to the server is bad.

Please note that using file names without directories in Emacs means
that the file is presumed to live in the current-buffer's
default-directory.  I'm not sure I understand why this is correct in
this case, and neither am I sure that the server will interpret it
like that (because the server might run in a different directory).
But maybe I'm missing something important here.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Tue, 05 Nov 2024 19:38:01 GMT) Full text and rfc822 format available.

Message #23 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Sebastián Monía
 <sebastian <at> sebasmonia.com>
Cc: ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Tue, 5 Nov 2024 11:36:25 -0800
On 11/5/2024 9:08 AM, Eli Zaretskii wrote:
>> Cc: daniel watson <ozzloy <at> challenge-bot.com>, 65973 <at> debbugs.gnu.org
>> From: Sebastián Monía
>>   <sebastian <at> sebasmonia.com>
>> Date: Tue, 05 Nov 2024 09:34:46 -0500
>>
>>
>> /added Jim for visibility/
>>
>> This seems like something simple enough to merge.
>> Thoughts?
>>
>> ozzloy <ozzloy <at> gmail.com> writes:
>>>   bump
>>>
>>>   On Wed, Sep 13, 2023 at 11:10 PM daniel watson <ozzloy <at> challenge-bot.com> wrote:
>>>
>>>   0. in one terminal, run this http server
>>>      https://git.sr.ht/~ozzloy/emacs-bug-63941/tree/master/item/server.py
>>>   1. in another terminal, run
>>>      socat -v tcp-listen:8086,fork tcp:localhost:8085
>>>   2. browse to the page with EWW,
>>>      M-x eww <ENTER> localhost:8086 <ENTER>
>>>   3. put the cursor on the word "Browse" <ENTER>
>>>   4. select any file to which you have read access for uploading
>>>   5. put cursor on "Submit" <ENTER>
>>>   6. observe the full path of the file is sent to the server.  this is
>>>      visible in both the python output and the socat output.
>>>
>>>   i'm including the diff inline to make it easier to review without
>>>   downloading the attached file.
> 
> I'd like some rationale for this change.  The original report never
> explains why sending the full absolute file name to the server is bad.

I see three possible reasons: 1) there could be (probably minor) privacy 
issues with sending the directory structure along to a server; 2) as far 
as I'm aware, other browsers only pass the "leaf" of the filename; 3) 
RFC 2813 says that *recipients* should ignore any directories:

   The receiving MUA SHOULD NOT respect any directory path information
   that may seem to be present in the filename parameter.  The filename
   should be treated as a terminal component only.  Portable
   specification of directory paths might possibly be done in the future
   via a separate Content-Disposition parameter, but no provision is
   made for it in this draft.

RFC 2813 is primarily about mail clients, but MDN suggests following it 
in a web context as well: 
<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition>. 
So I think the RFC would suggest that it's *allowed* to send the 
directories in the "filename" field, but since the server is supposed to 
ignore it, there's no benefit to doing so.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Wed, 06 Nov 2024 03:31:02 GMT) Full text and rfc822 format available.

Message #26 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Sebastián Monía <sebastian <at> sebasmonia.com>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, ozzloy <at> challenge-bot.com,
 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Tue, 05 Nov 2024 22:30:01 -0500
Jim Porter <jporterbugs <at> gmail.com> writes:
> On 11/5/2024 9:08 AM, Eli Zaretskii wrote:
>> I'd like some rationale for this change.  The original report never
>> explains why sending the full absolute file name to the server is bad.
>
> I see three possible reasons: 1) there could be (probably minor)
> privacy issues with sending the directory structure along to a server;
> 2) as far as I'm aware, other browsers only pass the "leaf" of the
> filename; 3) RFC 2813 says that *recipients* should ignore any
> directories: [...]
> RFC 2813 is primarily about mail clients, but MDN suggests following
> it in a web context as well:
> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition>.

> So I think the RFC would suggest that it's *allowed* to send the
> directories in the "filename" field, but since the server is supposed
> to ignore it, there's no benefit to doing so.

I didn't get as far as Jim did. I assumed the concern was #1, and I knew
the rest of the path is ignored, so figured we should go ahead.

Regards,
Seb

-- 
Sebastián Monía
https://site.sebasmonia.com/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Wed, 06 Nov 2024 17:33:01 GMT) Full text and rfc822 format available.

Message #29 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: daniel watson <ozzloy <at> each.do>
To: Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: Jim Porter <jporterbugs <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>,
 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Wed, 06 Nov 2024 07:34:48 -0800
the rationale was initially #1.

every other browser i looked into sent the filename only.  based on
that, i was more confident that it was worth submitting a patch.

#3 seems like a good reason too, but i did not know about that until
reading this thread.

Sebastián Monía <sebastian <at> sebasmonia.com> writes:

> Jim Porter <jporterbugs <at> gmail.com> writes:
>> On 11/5/2024 9:08 AM, Eli Zaretskii wrote:
>>> I'd like some rationale for this change.  The original report never
>>> explains why sending the full absolute file name to the server is bad.
>>
>> I see three possible reasons: 1) there could be (probably minor)
>> privacy issues with sending the directory structure along to a server;
>> 2) as far as I'm aware, other browsers only pass the "leaf" of the
>> filename; 3) RFC 2813 says that *recipients* should ignore any
>> directories: [...]
>> RFC 2813 is primarily about mail clients, but MDN suggests following
>> it in a web context as well:
>> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition>.
>
>> So I think the RFC would suggest that it's *allowed* to send the
>> directories in the "filename" field, but since the server is supposed
>> to ignore it, there's no benefit to doing so.
>
> I didn't get as far as Jim did. I assumed the concern was #1, and I knew
> the rest of the path is ignored, so figured we should go ahead.
>
> Regards,
> Seb





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Wed, 06 Nov 2024 23:33:02 GMT) Full text and rfc822 format available.

Message #32 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jim Porter <jporterbugs <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>, 
 Sebastián Monía <sebastian <at> sebasmonia.com>
Cc: ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ;
 send filename, not full path, on EWW form submit
Date: Wed, 6 Nov 2024 23:30:54 +0000
Jim Porter <jporterbugs <at> gmail.com> writes:

> On 11/5/2024 9:08 AM, Eli Zaretskii wrote:
>
>> I'd like some rationale for this change.  The original report never
>> explains why sending the full absolute file name to the server is bad.
>
> I see three possible reasons: 1) there could be (probably minor) privacy
> issues with sending the directory structure along to a server;

From a privacy perspective, I don't think this we can really consider
this as a minor issue.

Users commonly use their full names, or another similarly unique
identifier, as their login name.  It goes without saying, that sending a
string such as "/home/myfullname/some/file" to a remote host completely
defeats all notions of preserving user privacy.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Thu, 07 Nov 2024 06:21:02 GMT) Full text and rfc822 format available.

Message #35 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: jporterbugs <at> gmail.com, ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org,
 ozzloy <at> gmail.com, sebastian <at> sebasmonia.com
Subject: Re: bug#65973: [PATCH] ;
 send filename, not full path, on EWW form submit
Date: Thu, 07 Nov 2024 08:20:41 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Wed, 6 Nov 2024 23:30:54 +0000
> Cc: ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
> 
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
> > On 11/5/2024 9:08 AM, Eli Zaretskii wrote:
> >
> >> I'd like some rationale for this change.  The original report never
> >> explains why sending the full absolute file name to the server is bad.
> >
> > I see three possible reasons: 1) there could be (probably minor) privacy
> > issues with sending the directory structure along to a server;
> 
> >From a privacy perspective, I don't think this we can really consider
> this as a minor issue.
> 
> Users commonly use their full names, or another similarly unique
> identifier, as their login name.  It goes without saying, that sending a
> string such as "/home/myfullname/some/file" to a remote host completely
> defeats all notions of preserving user privacy.

The private information can be in the file name you send as well, so
this is not a convincing argument.

But since the RFC says to ignore the leading directories, I think the
change is okay, provided we describe the rationale in the comments to
the code.  It is very unusual thing in Emacs to remove leading
directories from a file name, so doing so generally begs for some
commentary.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Thu, 07 Nov 2024 18:54:01 GMT) Full text and rfc822 format available.

Message #38 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Sebastián Monía
 <sebastian <at> sebasmonia.com>
Cc: ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org, ozzloy <at> gmail.com
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Thu, 7 Nov 2024 10:52:51 -0800
On 11/5/2024 11:36 AM, Jim Porter wrote:
> I see three possible reasons: 1) there could be (probably minor) privacy 
> issues with sending the directory structure along to a server; 2) as far 
> as I'm aware, other browsers only pass the "leaf" of the filename; 3) 
> RFC 2813 says that *recipients* should ignore any directories:

Just in case people get confused here (I did, upon re-reading my 
message): The correct RFC is 2183, not 2813.




Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Thu, 07 Nov 2024 19:01:01 GMT) Full text and rfc822 format available.

Notification sent to daniel watson <ozzloy <at> challenge-bot.com>:
bug acknowledged by developer. (Thu, 07 Nov 2024 19:01:02 GMT) Full text and rfc822 format available.

Message #43 received at 65973-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Stefan Kangas <stefankangas <at> gmail.com>
Cc: sebastian <at> sebasmonia.com, ozzloy <at> challenge-bot.com, ozzloy <at> gmail.com,
 65973-done <at> debbugs.gnu.org
Subject: Re: bug#65973: [PATCH] ; send filename, not full path, on EWW form
 submit
Date: Thu, 7 Nov 2024 10:58:57 -0800
On 11/6/2024 10:20 PM, Eli Zaretskii wrote:
> But since the RFC says to ignore the leading directories, I think the
> change is okay, provided we describe the rationale in the comments to
> the code.  It is very unusual thing in Emacs to remove leading
> directories from a file name, so doing so generally begs for some
> commentary.

It sounds like we all agree on doing this for various reasons. I've now 
merged this to the master branch as f6b55678d76 with some commentary 
mentioning RFC 2183, so closing this bug.

Of course, if the commentary is insufficient or anyone notices any other 
issues, just let me know.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65973; Package emacs. (Fri, 08 Nov 2024 01:35:02 GMT) Full text and rfc822 format available.

Message #46 received at 65973 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: jporterbugs <at> gmail.com, ozzloy <at> challenge-bot.com, 65973 <at> debbugs.gnu.org,
 ozzloy <at> gmail.com, sebastian <at> sebasmonia.com
Subject: Re: bug#65973: [PATCH] ;
 send filename, not full path, on EWW form submit
Date: Fri, 8 Nov 2024 01:33:36 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

> The private information can be in the file name you send as well, so
> this is not a convincing argument.

True, but then at least it's obvious to the user that private
information is being sent.  Leaking your username on file upload is not
something that I believe most users would expect.  I didn't, at least.

> But since the RFC says to ignore the leading directories, I think the
> change is okay, provided we describe the rationale in the comments to
> the code.  It is very unusual thing in Emacs to remove leading
> directories from a file name, so doing so generally begs for some
> commentary.

It seems like we agree then, thanks.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 06 Dec 2024 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 97 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.