all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: rms@gnu.org
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: Bidirectional text and URLs
Date: Mon, 08 Dec 2014 17:46:49 +0200	[thread overview]
Message-ID: <83zjayxhxy.fsf@gnu.org> (raw)
In-Reply-To: <E1Xxm9p-00016c-AB@fencepost.gnu.org>

> Date: Sun, 07 Dec 2014 19:26:33 -0500
> From: Richard Stallman <rms@gnu.org>
> CC: larsi@gnus.org, emacs-devel@gnu.org
> 
>  > > If so, the questionis: once you detect the strangeness, what then?
> 
>   > It's up to the application.
> 
> Alas, that's ducking the issue.  We need to confront this issue.

We _are_ confronting it.  We are methodically analyzing the issue
piecemeal, identifying the separate parts of it, and providing
solutions to each part as soon as it is well-defined and understood.

The problem we are dealing with is a very complex one.  It involves
multiple disciplines: bidi reordering, URL construction and display,
Internet security, cultural differences, human perception of visual
cues, etc.  Part of the solution should be in the infrastructure and
primitives, part on the application and UI level.  Moreover, we are in
uncharted territory, with no prior art or standards to guide us.
Plus, we don't have any single individual on board who'd have a good
understanding of all the aspects of the problem.

When dealing with such hard issues, it is IME methodologically wrong
to charge ahead without a sufficiently clear definition and
understanding of each part of the problem and the alternatives for
their solutions.

We have now identified the first part: how to find the potentially
fraudulent URL, and we have a clear understanding of it.  We have a
solution for that part of the problem that seems to satisfy the
requirements of the application programmer who brought up this issue.

The next step should be for the application to try using this
infrastructure to address the issue on the application and UI levels.
It is possible that that such an attempt will result in feedback that
will require changes in the infrastructure, or some additional
functionality there.  Or the application developers will decide that
this part of the problem is successfully solved, and will request
assistance in solving the next part, which will need to be defined in
clear terms.

And so on and so forth -- we will break this complex issue into
individual parts and solve them one by one on the level each part
belongs to.  That's not "ducking the issue" in my book.

What you seem to expect is that we start coding solutions to problems
that are at best very vaguely defined, without any practical
experience to back that up, guided only by some intuition.  IME, this
is a recipe for wrong solutions and for waste of time and energy.  I
submit that there's no one around here, including myself, whose
intuition in this matter I would trust, because intuition is only
reliable when it is based on knowledge and experience in the subject
matter, and we don't have such individuals at our disposal.

So I don't see any reasons to rush into coding under the
circumstances.

>   > That's easy: copy the text without the directional override and
>   > display it in some other buffer.  The position returned by
>   > bidi-find-overridden-directionality is of the 1st character following
>   > the override control, so copying the text starting at that position
>   > will exclude the override and avoid its effects.
> 
> That is the first magic bidi char, but there could be more.

Inside the URL?  Extremely unlikely, see below.  In any case, the
presented use case didn't have them.  I'd like to see a complete
solution for this simple use case, before we move to more complex ones
(if they exist).

> It would be necessary to remove them all.

I don't think it's a problem, not a likely one anyway.  But if it is,
it should be almost trivial to use that primitive iteratively to
reconstruct the string with all the overrides removed.

> However, is simply removing them correct?

Yes, I think so.

> In general, do magic bidi characters get include in the URL that is
> passed to the browser?  I would expect so.

Using the directional control characters as part of the URL is
forbidden by the relevant standards.  The authorities that approve
domain names will reject them if they include such characters.  So I
think URLs which include them will be non-existent, or at least very
rare.  The use case which started this thread of discussion had the
control characters outside the URL itself, even outside the protocol
part of it.

> If so, a string which does not include them is inaccurate, and the
> accurate thing to do is to include them and display them (perhaps in
> hex) while suppressing their bidi effect.

Removing them and suppressing their effect give rise to the same
visual appearance, since these controls display as very thin spaces,
and thus are almost invisible on the screen.  That's why this type of
fraud came into existence in the first place.

As for using hex, that was one alternative I suggested earlier in this
thread.  It is still on the table, and doesn't require any
infrastructure changes to do its job.  But people liked this proposal
less, so eventually I coded the primitive to find the spoofed
characters as a means for supporting other solutions.

> Also, don't some RTL characters cause some normally LTR characters to
> display RTL?

No.  LTR characters always display left to right, unless overridden by
the RLO control (which simply makes every character act as an RTL
character).



  reply	other threads:[~2014-12-08 15:46 UTC|newest]

Thread overview: 133+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-28  2:51 Bidirectional text and URLs Lars Magne Ingebrigtsen
2014-11-28  3:27 ` Stephen J. Turnbull
2014-11-28 14:54   ` Eli Zaretskii
2014-11-29  6:09     ` Stephen J. Turnbull
2014-11-29  8:22       ` Eli Zaretskii
2014-11-29 17:05         ` Richard Stallman
2014-11-29 17:13           ` Lars Magne Ingebrigtsen
2014-11-29 17:49             ` Lars Magne Ingebrigtsen
2014-11-29 17:54               ` Lars Magne Ingebrigtsen
2014-11-29 18:24                 ` Eli Zaretskii
2014-11-29 18:29                   ` Lars Magne Ingebrigtsen
2014-11-30  9:38                   ` Richard Stallman
2014-11-30 15:21                     ` Eli Zaretskii
2014-11-29 18:18               ` Eli Zaretskii
2014-11-29 18:33                 ` Lars Magne Ingebrigtsen
2014-11-29 18:47                   ` Eli Zaretskii
2014-11-29 19:12                     ` Andreas Schwab
2014-11-29 19:31                       ` Lars Magne Ingebrigtsen
2014-11-29 19:39                         ` Andreas Schwab
2014-11-29 20:13                       ` Eli Zaretskii
2014-11-30 16:26                 ` Lars Magne Ingebrigtsen
2014-11-30 17:29                   ` Yuri Khan
2014-11-30 17:57                     ` Lars Magne Ingebrigtsen
2014-11-30 18:18                       ` Eli Zaretskii
2014-11-30 17:53                   ` Eli Zaretskii
2014-11-30 18:13                     ` Lars Magne Ingebrigtsen
2014-11-30 19:06                       ` Lars Magne Ingebrigtsen
2014-11-30 19:10                         ` Lars Magne Ingebrigtsen
2014-11-30 20:41                           ` Eli Zaretskii
2014-11-30 19:19                       ` Lars Magne Ingebrigtsen
2014-11-30 21:05                       ` Eli Zaretskii
2014-11-30 21:36                         ` Lars Magne Ingebrigtsen
2014-12-01  3:45                           ` Eli Zaretskii
2014-12-01 16:19                             ` Lars Magne Ingebrigtsen
2014-12-01 17:39                               ` Eli Zaretskii
2014-12-01 17:49                                 ` Lars Magne Ingebrigtsen
2014-12-01 18:22                                   ` Eli Zaretskii
2014-12-01 18:28                                     ` Lars Magne Ingebrigtsen
2014-12-02 14:17                                       ` Eli Zaretskii
2014-12-02 16:31                                         ` Lars Magne Ingebrigtsen
2014-12-01 19:15                         ` Richard Stallman
2014-12-01 19:15                         ` Richard Stallman
2014-12-01 19:34                           ` Eli Zaretskii
2014-12-01 20:21                             ` Eli Zaretskii
2014-12-01 20:30                               ` David Kastrup
2014-12-01 20:45                                 ` Eli Zaretskii
2014-12-02 14:45                                   ` Richard Stallman
2014-12-02 14:45                               ` Richard Stallman
2014-12-02 15:03                                 ` Eli Zaretskii
2014-12-03  8:39                                   ` Richard Stallman
2014-12-03 17:39                                     ` Eli Zaretskii
2014-12-04  9:41                                       ` Eli Zaretskii
2014-12-05 11:16                                         ` Richard Stallman
2014-12-05 11:28                                           ` Eli Zaretskii
2014-12-05 22:43                                             ` Richard Stallman
2014-12-05 23:15                                               ` Eli Zaretskii
2014-12-06 12:06                                                 ` Richard Stallman
2014-12-06 12:59                                                   ` Eli Zaretskii
2014-12-05 22:43                                             ` Richard Stallman
2014-12-05 23:17                                               ` Eli Zaretskii
2014-12-06 12:06                                                 ` Richard Stallman
2014-12-02 14:44                             ` Richard Stallman
2014-12-02 15:00                               ` Eli Zaretskii
2014-12-03  8:39                                 ` Richard Stallman
2014-11-30  9:38               ` Richard Stallman
2014-11-30 15:27                 ` Eli Zaretskii
2014-12-01 10:17                   ` Richard Stallman
2014-12-01 16:17                     ` Eli Zaretskii
2014-12-02 14:42                       ` Richard Stallman
2014-12-02 14:48                         ` Eli Zaretskii
2014-12-03  8:38                           ` Richard Stallman
2014-12-03 11:56                             ` Nicolas Richard
2014-12-03 17:12                               ` Richard Stallman
2014-12-03 17:38                             ` Eli Zaretskii
2014-12-04 14:30                               ` Richard Stallman
2014-12-04 15:53                                 ` Stefan Monnier
2014-12-04 17:30                                   ` Eli Zaretskii
2014-12-04 20:25                                   ` Paul Eggert
2014-12-02 14:42                       ` Richard Stallman
2014-12-02 14:52                         ` Eli Zaretskii
2014-12-02 18:05                           ` Eli Zaretskii
2014-12-03 17:13                             ` Richard Stallman
2014-12-03 18:14                               ` Eli Zaretskii
2014-12-05 22:44                                 ` Richard Stallman
2014-12-05 23:19                                   ` Eli Zaretskii
2014-12-07  9:20                                     ` Richard Stallman
2014-12-07 15:50                                       ` Eli Zaretskii
2014-12-08  0:26                                         ` Richard Stallman
2014-12-08 15:46                                           ` Eli Zaretskii [this message]
2014-12-03 17:13                           ` Richard Stallman
2014-12-03 17:13                           ` Richard Stallman
2014-11-29 17:14         ` Ted Zlatanov
2014-11-30 13:42         ` Stephen J. Turnbull
2014-11-30 15:36           ` Eli Zaretskii
2014-12-01 10:18           ` Richard Stallman
2014-12-01 16:18             ` Eli Zaretskii
2014-12-01 18:32               ` Stephen J. Turnbull
2014-12-01 19:12                 ` Eli Zaretskii
2014-12-01 20:08                   ` Stephen J. Turnbull
2014-12-01 20:42                     ` Eli Zaretskii
2014-12-02 14:42               ` Richard Stallman
2014-12-02 14:54                 ` Eli Zaretskii
2014-12-03  8:39                   ` Richard Stallman
2014-11-28 11:19 ` Ted Zlatanov
2014-11-28 13:58   ` Lars Magne Ingebrigtsen
2014-11-28 19:49     ` Ted Zlatanov
2014-11-28 21:02       ` Stefan Monnier
2014-11-29  0:26         ` Ted Zlatanov
2014-11-28 22:26       ` Eli Zaretskii
2014-11-28 14:24   ` Stefan Monnier
2014-11-28 14:57   ` Eli Zaretskii
2014-11-29  6:17   ` Stephen J. Turnbull
2014-11-28 14:45 ` Eli Zaretskii
2014-11-28 17:09 ` Richard Stallman
2014-11-28 18:28   ` Eli Zaretskii
2014-11-29 17:03     ` Richard Stallman
2014-11-29 17:06       ` Eli Zaretskii
2014-11-30  9:37         ` Richard Stallman
2014-11-30 15:16           ` Eli Zaretskii
2014-12-01 10:18             ` Richard Stallman
2014-12-01 16:02               ` Eli Zaretskii
2014-11-28 19:28   ` Andreas Schwab
2014-11-29 17:04     ` Richard Stallman
2014-11-29 17:11       ` Eli Zaretskii
2014-11-30  9:38         ` Richard Stallman
2014-11-30 15:20           ` Eli Zaretskii
2014-11-30 23:39             ` chad
2014-12-01  3:49               ` Eli Zaretskii
2014-12-01  8:01                 ` chad
2014-12-01 15:58                   ` Eli Zaretskii
2014-12-02 14:41                     ` Richard Stallman
2014-12-01 19:17                   ` Richard Stallman
2014-12-01 10:18             ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zjayxhxy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.