Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You are a bundle of energy, always on the go.


comp / comp.unix.programmer / Re: security by kees-cookity [rant]

SubjectAuthor
* security by kees-cookity [rant]Rainer Weikusat
`* Re: security by kees-cookity [rant]Kaz Kylheku
 `* Re: security by kees-cookity [rant]Rainer Weikusat
  +- Re: security by kees-cookity [rant]Muttley
  `* Re: security by kees-cookity [rant]Richard Kettlewell
   `* Re: security by kees-cookity [rant]Rainer Weikusat
    `* Re: security by kees-cookity [rant]Richard Kettlewell
     +- Re: security by kees-cookity [rant]Rainer Weikusat
     `* Re: security by kees-cookity [rant]John Ames
      +- Re: security by kees-cookity [rant]Kaz Kylheku
      +* Re: security by kees-cookity [rant]John Ames
      |`* Re: security by kees-cookity [rant]Rainer Weikusat
      | `* Re: security by kees-cookity [rant]Muttley
      |  `* Re: security by kees-cookity [rant]Nicolas George
      |   +* Re: security by kees-cookity [rant]Scott Lurndal
      |   |+* Re: security by kees-cookity [rant]Rainer Weikusat
      |   ||+* Re: security by kees-cookity [rant]Muttley
      |   |||+* Re: security by kees-cookity [rant]Scott Lurndal
      |   ||||`- Re: security by kees-cookity [rant]Muttley
      |   |||`* Re: security by kees-cookity [rant]Rainer Weikusat
      |   ||| `* Re: security by kees-cookity [rant]Muttley
      |   |||  `* Re: security by kees-cookity [rant]Rainer Weikusat
      |   |||   `* Re: security by kees-cookity [rant]Muttley
      |   |||    `* Re: security by kees-cookity [rant]Rainer Weikusat
      |   |||     `* Re: security by kees-cookity [rant]Muttley
      |   |||      `- Re: security by kees-cookity [rant]Rainer Weikusat
      |   ||`* Re: security by kees-cookity [rant]Keith Thompson
      |   || `* create temporary files (was: security by kees-cookity [rant])Rainer Weikusat
      |   ||  `- Re: create temporary files (was: security by kees-cookity [rant])Scott Lurndal
      |   |`- Re: security by kees-cookity [rant]James Kuyper
      |   `* Re: security by kees-cookity [rant]Muttley
      |    `* Re: security by kees-cookity [rant]Nicolas George
      |     `* Re: security by kees-cookity [rant]Muttley
      |      +- Re: security by kees-cookity [rant]Muttley
      |      `* Re: security by kees-cookity [rant]Nicolas George
      |       `* Re: security by kees-cookity [rant]Muttley
      |        `* Re: security by kees-cookity [rant]Nicolas George
      |         `- Re: security by kees-cookity [rant]John Ames
      `* Re: security by kees-cookity [rant]Richard Kettlewell
       +* Re: security by kees-cookity [rant]John Ames
       |`* Re: security by kees-cookity [rant]Richard Kettlewell
       | `* Re: security by kees-cookity [rant]John Ames
       |  `* Re: security by kees-cookity [rant]Richard Kettlewell
       |   `* Re: security by kees-cookity [rant]Rainer Weikusat
       |    `* Re: security by kees-cookity [rant]Richard Kettlewell
       |     +- Re: security by kees-cookity [rant]Rainer Weikusat
       |     `- Re: security by kees-cookity [rant]John Ames
       `- Re: security by kees-cookity [rant]Kaz Kylheku

Pages:12
Subject: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Thu, 23 May 2024 20:44 UTC
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: security by kees-cookity [rant]
Date: Thu, 23 May 2024 21:44:06 +0100
Lines: 45
Message-ID: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net eb0YAABHu6LsN1fymLeTAgIFyL/2SDiyxrynbpBUZo8ore7QA=
Cancel-Lock: sha1:CvQJXBNToh1DJG4ArrDlj7Z+K7w= sha1:wNiML96al6IqX47aS0t8H9sXmbs= sha256:+YGh7YzIOHe8PtNT+YV54yt+0lFwY07uzEhmKFZkF38=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

or "Maybe, I'm full of it BUT I work for Google ... !"

I have program for executing another program with some fnctl-based file
locks held I've been using for almost 20 years. This program always
opens files with O_CREAT added to the mode so that, in case of multiple
concurrent calls of it and no previously existing file, one of these
calls creates the file and all others open it.

Further, I have a directory with the following permissions:

drwxrwx--T 6 root caca 4096 May 23 20:22 ca-CA/

as I want members of the caca group to be able to create files in this
directory but not remove files owned by root. Inside this directory,
there's a file with the following permissions:

-rw-r--r-- 1 caca caca 3 Jan 1 1970 serial

A shell script associated with that tries to acquire an R/W lock on this
file in order to serialize concurrent invocations of it. On Debian 12,
when running as root, this fails with EACCES. That's do to a suckurity
feature (supposed to make the system suck harder) documented as follows (proc(5)):

/proc/sys/fs/protected_regular (since Linux 4.19)

1 Don't allow O_CREAT open(2) on regular files that the caller doesn't
own in world-writable sticky directories, unless the regular file is
owned by the owner of the directory.

2 As for the value 1, but the restriction also applies to
group-writable sticky directories.

The intent of the above protections is similar to protected_fifos, but
allows an application to avoid writes to an attacker-controlled regular
file, where the application expected to create one.

and default value of this control knob is - for maxium suckurity because
Google says that's how it must be done and Google CANNOT be wrong!!! -
obviously 2.
Who told this hyperintelligent being that O_CREAT means "application
expected to create a file" AND NOT "create file if it doesn't exist
already", ie, the documented semantics?

GRRRR.

Subject: Re: security by kees-cookity [rant]
From: Kaz Kylheku
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Fri, 24 May 2024 01:36 UTC
References: 1
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Fri, 24 May 2024 01:36:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <20240523182552.895@kylheku.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
Injection-Date: Fri, 24 May 2024 03:36:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e11ec59bf0ae08b37203ccb330e57e74";
logging-data="2244912"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UqGz21GnkrB07ZM3QFVD37d6VYJdqmpQ="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:6hIovjCbfNKVOcBXb6Ia3CJBbXU=
View all headers

On 2024-05-23, Rainer Weikusat <rweikusat@talktalk.net> wrote:
> /proc/sys/fs/protected_regular (since Linux 4.19)
>
> 1 Don't allow O_CREAT open(2) on regular files that the caller doesn't
> own in world-writable sticky directories, unless the regular file is
> owned by the owner of the directory.

That makes no sense. In the absence of O_EXCL, O_CREAT pertains to files
that don't exist. Files that don't exist do not have an owner.

If the file exists, and O_CREAT is specified, but not O_EXCL, then
O_CREAT means nothing.

(If the file doesn't exist, the caller will own it when it gets created,
so "that the caller doesn't own" will not apply.)

> 2 As for the value 1, but the restriction also applies to
> group-writable sticky directories.
>
> The intent of the above protections is similar to protected_fifos, but
> allows an application to avoid writes to an attacker-controlled regular
> file, where the application expected to create one.

IF the application expects to create a file, it should specify
O_EXCL | O_CREAT. That will then fail if the file exists already.

If a file is attacker-controlled, that is independent of the
circumstances of its creation.

We can think about a protection mechanism that, in certain directories,
prevents a process from obtaining an open file descriptor to an
attacker-controlled file, regardless of whether it is being created.

Such a mechanism won't be looking at whether O_CREAT is present
in the open request, since it is bad to open an attacker-controlled
file whether creating it or not.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Subject: Re: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Fri, 24 May 2024 15:32 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Fri, 24 May 2024 16:32:53 +0100
Lines: 55
Message-ID: <87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net EX1DWpbG3TmNun8NOESeSwBPo/DDncr7eFSlGzGG4rb0a6BV8=
Cancel-Lock: sha1:+yK2pUy3c5/EeCpYJbWrs5vuvzc= sha1:vZkbbP5cWi3WeZsNCMpUHThIQ3c= sha256:CL/nsmlW5N5Crw+f83uA3m5wJKOQiWO9QS6mzBeVstg=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

Kaz Kylheku <643-408-1753@kylheku.com> writes:
> On 2024-05-23, Rainer Weikusat <rweikusat@talktalk.net> wrote:
>> /proc/sys/fs/protected_regular (since Linux 4.19)
>>
>> 1 Don't allow O_CREAT open(2) on regular files that the caller doesn't
>> own in world-writable sticky directories, unless the regular file is
>> owned by the owner of the directory.
>
> That makes no sense. In the absence of O_EXCL, O_CREAT pertains to files
> that don't exist. Files that don't exist do not have an owner.
>
> If the file exists, and O_CREAT is specified, but not O_EXCL, then
> O_CREAT means nothing.

This is obviously supposed to refer to the one use-case of O_CREAT the
guy who authored this could think of: Broken application trying to create a
temporary file in an insecure way. The application is broken as it would
need to use O_EXCL to achieve the intended semantics. This means this is
a workaround supposed to cause broken applications to fail in harmless
ways which happens to break correct application trying to cooperate with
other correct applications wrt using a partiuclar file.

It's basically a coded opinion statement: I the undersigned really think
O_CREAT should fail when the file already exists!

[...]

>> 2 As for the value 1, but the restriction also applies to
>> group-writable sticky directories.
>>
>> The intent of the above protections is similar to protected_fifos, but
>> allows an application to avoid writes to an attacker-controlled regular
>> file, where the application expected to create one.

[...]

> If a file is attacker-controlled, that is independent of the
> circumstances of its creation.
>
> We can think about a protection mechanism that, in certain directories,
> prevents a process from obtaining an open file descriptor to an
> attacker-controlled file, regardless of whether it is being created.

This leads to another question: What on G*ds f***ing earth is "an
attacker controlled regular file" security-wise? It's not that regular
files do anything. They just store data. I can think of seriously
contrived issue here, namely, broken app tries to create a file with
restrictive permissions in order to write $super_secret_stuff to it and
accidentally writes it to a file readable by another user instead. If
that's a real issue, I haven't heard of it yet. And I certainly don't
think this justifies breaking working, correct code which makes use of
UNIX semantics some Google employee happens to dislike.

"We must do something about security! This is said to be something about
security. Therefore, we must do it!" ("Yes minister" paraphrase).

Subject: Re: security by kees-cookity [rant]
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Fri, 24 May 2024 15:44 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Fri, 24 May 2024 15:44:20 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <v2qckj$2cv3t$1@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
Injection-Date: Fri, 24 May 2024 17:44:20 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="40b48e283b50c36d2d708fdc7b821378";
logging-data="2522237"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P+6QfXQ+L/pO+lTo9ysif"
Cancel-Lock: sha1:IXTRtcl+a7qneSbLPqgcR2o71Ws=
View all headers

On Fri, 24 May 2024 16:32:53 +0100
Rainer Weikusat <rweikusat@talktalk.net> wrote:
>Kaz Kylheku <643-408-1753@kylheku.com> writes:
>> We can think about a protection mechanism that, in certain directories,
>> prevents a process from obtaining an open file descriptor to an
>> attacker-controlled file, regardless of whether it is being created.
>
>This leads to another question: What on G*ds f***ing earth is "an
>attacker controlled regular file" security-wise? It's not that regular
>files do anything. They just store data. I can think of seriously
>contrived issue here, namely, broken app tries to create a file with
>restrictive permissions in order to write $super_secret_stuff to it and
>accidentally writes it to a file readable by another user instead. If
>that's a real issue, I haven't heard of it yet. And I certainly don't
>think this justifies breaking working, correct code which makes use of
>UNIX semantics some Google employee happens to dislike.

Changing things that work because someone doesn't like them seems to be par for
the course these days. See systemd, wayland, pulse audio.

Some people can't or won't learn from what others have done before and think
they have some kind of magic insight into developing something better. Rarely
does that turn out to be the case.

Subject: Re: security by kees-cookity [rant]
From: Richard Kettlewell
Newsgroups: comp.unix.programmer
Organization: terraraq NNTP server
Date: Sat, 25 May 2024 13:06 UTC
References: 1 2 3
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Sat, 25 May 2024 14:06:22 +0100
Organization: terraraq NNTP server
Message-ID: <wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="117573"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:vYYvQE1xE/+iACmd9XDo5aX1XR0=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
View all headers

Rainer Weikusat <rweikusat@talktalk.net> writes:
> This leads to another question: What on G*ds f***ing earth is "an
> attacker controlled regular file" security-wise? It's not that regular
> files do anything. They just store data. I can think of seriously
> contrived issue here, namely, broken app tries to create a file with
> restrictive permissions in order to write $super_secret_stuff to it and
> accidentally writes it to a file readable by another user instead. If
> that's a real issue, I haven't heard of it yet.

The typical example is an install script which downloads the main
installer to a predictable filename in /tmp and then executes it.
Broken, indeed, but nevertheless a recurring issue.

The attacker pre-creates the download file with 0777 permission and then
injects their own code into it; it will subsequently be run as the
victim user. There’s a race to win here, i.e. getting a modification in
before execution completes, but it seems to be easy in practice.

People presumably set protected_regular=0 if the attack scenario never
arises in their environment, or if they prefer to take the risk.

--
https://www.greenend.org.uk/rjk/

Subject: Re: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Sun, 26 May 2024 11:09 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Supersedes: <87jzjghlv3.fsf@doppelsaurus.mobileactivedefense.com>
Date: Sun, 26 May 2024 12:09:01 +0100
Lines: 45
Message-ID: <87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 9dUzgBe/7f1cc4/nuC6WUA99E960eGiT1I/eg6hxX5VfUJ17w=
Cancel-Lock: sha1:hj26M+l89ojPtvHVxacUgd2e1Gw= sha1:qraEfOij413LLu3r+uWKFdqsrtQ= sha256:L0Jz/sd98f2kPPLt7rUURJ/t5fOmaeBdlTp0ezu/nCg=
Cancel-Key: sha1:PKtEy9+MV4MHIMTWl9QTjdoLaOo= sha1:emXEAAfjv7HHZadQu3yJtN4rvCQ= sha256:lgYMUuCOfoBHwtAvAmzzNlOGPr6UaKxVQuUQG5cy+/o=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

Richard Kettlewell <invalid@invalid.invalid> writes:
> Rainer Weikusat <rweikusat@talktalk.net> writes:
>> This leads to another question: What on G*ds f***ing earth is "an
>> attacker controlled regular file" security-wise? It's not that regular
>> files do anything. They just store data. I can think of seriously
>> contrived issue here, namely, broken app tries to create a file with
>> restrictive permissions in order to write $super_secret_stuff to it and
>> accidentally writes it to a file readable by another user instead. If
>> that's a real issue, I haven't heard of it yet.
>
> The typical example is an install script which downloads the main
> installer to a predictable filename in /tmp and then executes it.
> Broken, indeed, but nevertheless a recurring issue.

That's not really broken, only stupid. The broken bit is not using
O_EXCL to create the file. And the broken bit of the chokearound is
changing well-documented semantics of open flags with real uses cases
based on the assumption that O_EXCL must have been 'forgotten'.

> The attacker pre-creates the download file with 0777 permission and then
> injects their own code into it; it will subsequently be run as the
> victim user.
>
> There’s a race to win here, i.e. getting a modification in
> before execution completes, but it seems to be easy in practice.

There's another 'race' to win here, namely, it must somehow be known
that a broken install script is about to be executed in order to
'attack' anyone. And "download random crap from the internet and run it"
is a recipe for disaster, anyway: The 'install script' is already
running as "the victim user" and offers a much more direct route to
victimising someone.

> People presumably set protected_regular=0 if the attack scenario never
> arises in their environment, or if they prefer to take the risk.

If people actually do that (going against system defaults is an uphill
battle), sooner or later, a second control file will appear with values

0 - pay attention to the setting in the original file
1 - pay attention to the setting in the original fikle every 3rd Thursday
2 - break O_CREAT, correct code be fucked!

will appear (default again 2, obviously).

Subject: Re: security by kees-cookity [rant]
From: Richard Kettlewell
Newsgroups: comp.unix.programmer
Organization: terraraq NNTP server
Date: Mon, 27 May 2024 08:19 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Mon, 27 May 2024 09:19:30 +0100
Organization: terraraq NNTP server
Message-ID: <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="9813"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:ODpNOATJnurQ9W+3JzvZ535A/zI=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
View all headers

Rainer Weikusat <rweikusat@talktalk.net> writes:
> Richard Kettlewell <invalid@invalid.invalid> writes:
>> Rainer Weikusat <rweikusat@talktalk.net> writes:
>>> This leads to another question: What on G*ds f***ing earth is "an
>>> attacker controlled regular file" security-wise? It's not that regular
>>> files do anything. They just store data. I can think of seriously
>>> contrived issue here, namely, broken app tries to create a file with
>>> restrictive permissions in order to write $super_secret_stuff to it and
>>> accidentally writes it to a file readable by another user instead. If
>>> that's a real issue, I haven't heard of it yet.
>>
>> The typical example is an install script which downloads the main
>> installer to a predictable filename in /tmp and then executes it.
>> Broken, indeed, but nevertheless a recurring issue.
>
> That's not really broken, only stupid. The broken bit is not using
> O_EXCL to create the file. And the broken bit of the chokearound is
> changing well-documented semantics of open flags with real uses cases
> based on the assumption that O_EXCL must have been 'forgotten'.

The adjective used to describe it isn’t the point. The point is that it
keeps happening.

>> The attacker pre-creates the download file with 0777 permission and
>> then injects their own code into it; it will subsequently be run as
>> the victim user.
>>
>> There’s a race to win here, i.e. getting a modification in before
>> execution completes, but it seems to be easy in practice.
>
> There's another 'race' to win here, namely, it must somehow be known
> that a broken install script is about to be executed in order to
> 'attack' anyone.

Easy enough to arrange in a shared environment. Find a bit of software
relevant to the attacker’s job (or the job of whoever’s unprivileged
login they’ve compromised) and ask the IT department to install it.

--
https://www.greenend.org.uk/rjk/

Subject: Re: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Mon, 27 May 2024 16:19 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Mon, 27 May 2024 17:19:09 +0100
Lines: 76
Message-ID: <87zfsbz0qq.fsf@doppelsaurus.mobileactivedefense.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 16GQLjpYvxUqnU6kPuXVJgy1WweWiIebEsuZQuIP6U50kg7CA=
Cancel-Lock: sha1:0o/gzoyrjbZ60YRQAmo4LrGgjRc= sha1:+CVTJ+heu6csvUc2H8YLUNYDBd0= sha256:LZQmZB7mdWUnUfjEe6rjnQTJc/1F4l/VBzu25ocbvI4=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

Richard Kettlewell <invalid@invalid.invalid> writes:
> Rainer Weikusat <rweikusat@talktalk.net> writes:
>> Richard Kettlewell <invalid@invalid.invalid> writes:
>>> Rainer Weikusat <rweikusat@talktalk.net> writes:
>>>> This leads to another question: What on G*ds f***ing earth is "an
>>>> attacker controlled regular file" security-wise? It's not that regular
>>>> files do anything. They just store data. I can think of seriously
>>>> contrived issue here, namely, broken app tries to create a file with
>>>> restrictive permissions in order to write $super_secret_stuff to it and
>>>> accidentally writes it to a file readable by another user instead. If
>>>> that's a real issue, I haven't heard of it yet.
>>>
>>> The typical example is an install script which downloads the main
>>> installer to a predictable filename in /tmp and then executes it.
>>> Broken, indeed, but nevertheless a recurring issue.
>>
>> That's not really broken, only stupid. The broken bit is not using
>> O_EXCL to create the file. And the broken bit of the chokearound is
>> changing well-documented semantics of open flags with real uses cases
>> based on the assumption that O_EXCL must have been 'forgotten'.
>
> The adjective used to describe it isn’t the point. The point is that it
> keeps happening.

It doesn't "keep happening" as this is not a natural phenomenon. At
best, that's something (certain) people keep doing. I also very much
dispute that this is an actual phenomenon at all and not just some
theoretical justification someone came up with for breaking stuff.

To recapitulate

1, It is conjectured that "install scripts" exist which create
executable temporary files in /tmp incorrectly and idiotically, that is,
by neither using one of the functions for doing so securely (mkstemp,
tmpfile) nor the kernel facility for this (O_TMPFILE open flag) nor the
proper set of open flags (O_CREAT | O_EXCL) and by using /tmp instead of
a readily available directory that's not world-writable, eg, the home
directory of the user in question.

2. It is further conjectured that a hostile third party exists which can
observe another user running a particular broken script which downloads code to
such a file in order to replace the content of the file between the
close call of the broken script (necessary to avoid ETXTBSY errors) and
the following execve, thereby possibly leading to execution of code
provided by the hostile third party.

and because this is conjectured, it's considered ok to break working
correct code trying to open files shared with other application in group
writable directories with the sticky bit set by 'silently' changing the
semantics of O_CREAT to imply O_EXCL but with a different error code
(EACCES instead of EEXIST).

And the onus for coping with the change is - of course - not on the
people who want it because they believe it'll help them but on people
relying on standardized UNIX semantics which have been in place since
some time in the 1970s, ie, it's not "enable this behaviour if you think
that's a problem you'll need to deal with" but "disable this behaviour
after it has caused you grief".

>>> The attacker pre-creates the download file with 0777 permission and
>>> then injects their own code into it; it will subsequently be run as
>>> the victim user.
>>>
>>> There’s a race to win here, i.e. getting a modification in before
>>> execution completes, but it seems to be easy in practice.
>>
>> There's another 'race' to win here, namely, it must somehow be known
>> that a broken install script is about to be executed in order to
>> 'attack' anyone.
>
> Easy enough to arrange in a shared environment. Find a bit of software
> relevant to the attacker’s job (or the job of whoever’s unprivileged
> login they’ve compromised) and ask the IT department to install it.

And a practical example of this is? And when was it last used for an
actual exploit?

Subject: Re: security by kees-cookity [rant]
From: John Ames
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 28 May 2024 14:57 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: commodorejohn@gmail.com (John Ames)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Tue, 28 May 2024 07:57:07 -0700
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <20240528075707.00004bcf@gmail.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Date: Tue, 28 May 2024 17:17:59 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f0f7f521dcacb2526c51500430d8f002";
logging-data="688765"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198Z6nsojgfJITZBJKiAEWqSpHH0jeYyTc="
Cancel-Lock: sha1:/tFbnU6+na0p9YySZk9W4uJtV98=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Mon, 27 May 2024 09:19:30 +0100
Richard Kettlewell <invalid@invalid.invalid> wrote:

> Easy enough to arrange in a shared environment. Find a bit of software
> relevant to the attacker’s job (or the job of whoever’s unprivileged
> login they’ve compromised) and ask the IT department to install it.

That's a social-engineering problem, not a software-engineering one.
Trying to solve "people in positions of responsibility aren't being
responsible" by technical means has never worked and *will* never work.

Subject: Re: security by kees-cookity [rant]
From: Kaz Kylheku
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 28 May 2024 16:22 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Tue, 28 May 2024 16:22:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <20240528092140.455@kylheku.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 28 May 2024 18:22:03 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a2df0b719a6b9710a001a6ab1f95315c";
logging-data="720779"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18eleIQCmhFhMkFrMWlEsdXysbk+CDP93Y="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:RbQavE/BOmf10YeDVvojv4REIG4=
View all headers

On 2024-05-28, John Ames <commodorejohn@gmail.com> wrote:
> On Mon, 27 May 2024 09:19:30 +0100
> Richard Kettlewell <invalid@invalid.invalid> wrote:
>
>> Easy enough to arrange in a shared environment. Find a bit of software
>> relevant to the attacker’s job (or the job of whoever’s unprivileged
>> login they’ve compromised) and ask the IT department to install it.
>
> That's a social-engineering problem, not a software-engineering one.
> Trying to solve "people in positions of responsibility aren't being
> responsible" by technical means has never worked and *will* never work.

And when something doesn't work, alll that is left is its risks
and downsides.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Subject: Re: security by kees-cookity [rant]
From: John Ames
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Tue, 28 May 2024 17:34 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: commodorejohn@gmail.com (John Ames)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Tue, 28 May 2024 10:34:38 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20240528103438.00005f0b@gmail.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 28 May 2024 19:34:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f0f7f521dcacb2526c51500430d8f002";
logging-data="688765"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+32QY89nxPBY4PV3JjAHNowWEgFW1TPe8="
Cancel-Lock: sha1:lFZU9VADwyv+ajBlOENDgwit8U4=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Tue, 28 May 2024 07:57:07 -0700
John Ames <commodorejohn@gmail.com> wrote:

> That's a social-engineering problem, not a software-engineering one.
> Trying to solve "people in positions of responsibility aren't being
> responsible" by technical means has never worked and *will* never
> work.

(On top of which, if the concern really boils down to "filename
collisions in /tmp are exploitable," it seems like it'd be *vastly*
less hazard-prone to come up with some mechanism for making /tmp an
alias for a user-specific mount point, compared to changing behavior of
fundamental system calls!

At the very least, if /tmp isn't mounted as noexec, you should probably
be asking yourself if there's any reason it *couldn't* be.)

Subject: Re: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Tue, 28 May 2024 20:44 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Tue, 28 May 2024 21:44:48 +0100
Lines: 47
Message-ID: <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<20240528103438.00005f0b@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net O4SLOk3uWzEBOuzz2vNH6QG7fF6HzJq5BMMWeB02NhPBXJBVo=
Cancel-Lock: sha1:bMJ0Dl9p4ZW9LuRCWwV09+xrG00= sha1:jPws2nX1hexkWvC3AbG6r1jzWSE= sha256:pGSNARSJbofpVpe3N74Yv/+Ytug/s+E0gxsxi2K0hpE=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

John Ames <commodorejohn@gmail.com> writes:
> On Tue, 28 May 2024 07:57:07 -0700
> John Ames <commodorejohn@gmail.com> wrote:
>
>> That's a social-engineering problem, not a software-engineering one.
>> Trying to solve "people in positions of responsibility aren't being
>> responsible" by technical means has never worked and *will* never
>> work.
>
> (On top of which, if the concern really boils down to "filename
> collisions in /tmp are exploitable,"

It's more like "Programs which wrongly assume they have exclusive
control over the filesystem name space, ie, which - due to lazinness or
incompetence of their resepective authors - fail to use the abundantly
availabe mechanisms for ensuring they exclusivley control 'their' names,
can be exploited."

And the workaround for this is "Define a heuristic in order classify
requests for non-exclusive access to file system names as likely
erronoeous and force them to fail based on this".

In it's most extreme form, this heuristic is "Directory is writable by
someone other than the directory owner, has the sticky bit set and the
accessed name isn't owned by the user the accessing process is running
as".

In my case, the directory in question is the top-level of a substree
used to provide an (OpenSSL-based) certificate authority. Day-to-day
operation of this CA, ie, issueing of certificates, are supposed to be
performed by a dedicated, unprivileged user allowed to create files in
the CA hierarchy by virtue of belonging the dedicated group created for
this purpose. But this user is not supposed to be allowed to remove
files of other users from the hierarchy (the top-level directory is
marked as sticky). A certain file in this hierarchy belonging to the
the user in question is used as (fcntl-based) lockfile to serialize
executions of a particular script. And the program trying to acquire
this lock tries to open lock files for exclusive access with O_RDWR |
O_CREAT. The idea behind this (not used here) is that such lockfiles can
be created on-the-fly. Assuming the file doesn't initially exist,
concurrent attempts to acquire the lock will cause the one which happens
to get to this first to create the file and all subsequent ones then
just open the already created file.

Unfortunately, this falls foul of the heuristic described above despite
it's not vulnerable to the supposed exploit.

Subject: Re: security by kees-cookity [rant]
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 07:10 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 07:10:32 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <v36kd8$11r1b$1@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<20240528103438.00005f0b@gmail.com>
<87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com>
Injection-Date: Wed, 29 May 2024 09:10:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfb490889791f03fcce85bc5172105c7";
logging-data="1109035"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+wUnhJdJpfpx6aQZtAcQp8"
Cancel-Lock: sha1:oA9UE5LxHizgoNX2LNbIRiPasTU=
View all headers

On Tue, 28 May 2024 21:44:48 +0100
Rainer Weikusat <rweikusat@talktalk.net> wrote:
>John Ames <commodorejohn@gmail.com> writes:
>> On Tue, 28 May 2024 07:57:07 -0700
>> John Ames <commodorejohn@gmail.com> wrote:
>>
>>> That's a social-engineering problem, not a software-engineering one.
>>> Trying to solve "people in positions of responsibility aren't being
>>> responsible" by technical means has never worked and *will* never
>>> work.
>>
>> (On top of which, if the concern really boils down to "filename
>> collisions in /tmp are exploitable,"
>
>It's more like "Programs which wrongly assume they have exclusive
>control over the filesystem name space, ie, which - due to lazinness or
>incompetence of their resepective authors - fail to use the abundantly
>availabe mechanisms for ensuring they exclusivley control 'their' names,
>can be exploited."

The simple answer being that no process uses /tmp unless it needs to share
data with another via files.

Subject: Re: security by kees-cookity [rant]
From: Richard Kettlewell
Newsgroups: comp.unix.programmer
Organization: terraraq NNTP server
Date: Wed, 29 May 2024 07:50 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 08:50:02 +0100
Organization: terraraq NNTP server
Message-ID: <wwv1q5ljbv9.fsf@LkoBDZeT.terraraq.uk>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="56127"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:KxWVKEdawc4ExTTZhGO3Okw1U1I=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
View all headers

John Ames <commodorejohn@gmail.com> writes:
> Richard Kettlewell <invalid@invalid.invalid> wrote:
>> Easy enough to arrange in a shared environment. Find a bit of software
>> relevant to the attacker’s job (or the job of whoever’s unprivileged
>> login they’ve compromised) and ask the IT department to install it.
>
> That's a social-engineering problem, not a software-engineering one.
> Trying to solve "people in positions of responsibility aren't being
> responsible" by technical means has never worked and *will* never work.

It’s easy to think of counterexamples: collision assist in a car, for
instance, or automatic braking systems in trains.

--
https://www.greenend.org.uk/rjk/

Subject: Re: security by kees-cookity [rant]
From: John Ames
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 14:44 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: commodorejohn@gmail.com (John Ames)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 07:44:26 -0700
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <20240529074426.00000142@gmail.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<wwv1q5ljbv9.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Date: Wed, 29 May 2024 16:44:29 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="38d6fab78ec32119edceaa2b190e6e24";
logging-data="1251998"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19NuZu17uhr5d3/i+Pw24+MNKcqoYoSD5M="
Cancel-Lock: sha1:ZNvJO/UCLOzef1pnsOIQR7tciuA=
X-Newsreader: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-w64-mingw32)
View all headers

On Wed, 29 May 2024 08:50:02 +0100
Richard Kettlewell <invalid@invalid.invalid> wrote:

> John Ames <commodorejohn@gmail.com> writes:
> > That's a social-engineering problem, not a software-engineering one.
> > Trying to solve "people in positions of responsibility aren't being
> > responsible" by technical means has never worked and *will* never
> > work.
>
> It’s easy to think of counterexamples: collision assist in a car, for
> instance, or automatic braking systems in trains.

Minimal-assistance-in-the-absence-of-direct-supervision is a *very*
different thing from intelligent-override-of-deliberate-action.

Subject: Re: security by kees-cookity [rant]
From: Nicolas George
Newsgroups: comp.unix.programmer
Organization: Guest of ProXad - France
Date: Wed, 29 May 2024 15:39 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp4-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: security by kees-cookity [rant]
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com> <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com> <20240528103438.00005f0b@gmail.com> <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com> <v36kd8$11r1b$1@dont-email.me>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 29 May 2024 15:39:08 GMT
Lines: 6
Message-ID: <66574c1c$0$8220$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 29 May 2024 17:39:08 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1716997148 news-3.free.fr 8220 129.199.129.80:57814
X-Complaints-To: abuse@proxad.net
View all headers

Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
a écrit :
> The simple answer being that no process uses /tmp unless it needs to share
> data with another via files.

So where should they put their temporary files?

Subject: Re: security by kees-cookity [rant]
From: Scott Lurndal
Newsgroups: comp.unix.programmer
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 29 May 2024 16:06 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.netnews.com!s1-1.netnews.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx40.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: security by kees-cookity [rant]
Newsgroups: comp.unix.programmer
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com> <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com> <20240528103438.00005f0b@gmail.com> <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com> <v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr>
Lines: 13
Message-ID: <0oI5O.7253$gkW.1029@fx40.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 29 May 2024 16:06:20 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 29 May 2024 16:06:20 GMT
X-Received-Bytes: 1359
X-Original-Bytes: 1308
View all headers

Nicolas George <nicolas$george@salle-s.org> writes:
>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
> a �crit�:
>> The simple answer being that no process uses /tmp unless it needs to share
>> data with another via files.
>
>So where should they put their temporary files?

$ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}

Note that /tmp and /var/tmp usually have the "Sticky" mode bit
set which limits the operations that a non-owner can
perform on a file in that directory.

Subject: Re: security by kees-cookity [rant]
From: Richard Kettlewell
Newsgroups: comp.unix.programmer
Organization: terraraq NNTP server
Date: Wed, 29 May 2024 16:20 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.gegeweb.eu!gegeweb.org!nntp.terraraq.uk!.POSTED.tunnel.sfere.anjou.terraraq.org.uk!not-for-mail
From: invalid@invalid.invalid (Richard Kettlewell)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 17:20:08 +0100
Organization: terraraq NNTP server
Message-ID: <wwvo78o3807.fsf@LkoBDZeT.terraraq.uk>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<wwv1q5ljbv9.fsf@LkoBDZeT.terraraq.uk>
<20240529074426.00000142@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: innmantic.terraraq.uk; posting-host="tunnel.sfere.anjou.terraraq.org.uk:172.17.207.6";
logging-data="64374"; mail-complaints-to="usenet@innmantic.terraraq.uk"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:OjpdBKjg1/V9y6vBR55Yu6jDoN0=
X-Face: h[Hh-7npe<<b4/eW[]sat,I3O`t8A`(ej.H!F4\8|;ih)`7{@:A~/j1}gTt4e7-n*F?.Rl^
F<\{jehn7.KrO{!7=:(@J~]<.[{>v9!1<qZY,{EJxg6?Er4Y7Ng2\Ft>Z&W?r\c.!4DXH5PWpga"ha
+r0NzP?vnz:e/knOY)PI-
X-Boydie: NO
View all headers

John Ames <commodorejohn@gmail.com> writes:
> Richard Kettlewell <invalid@invalid.invalid> wrote:
>> John Ames <commodorejohn@gmail.com> writes:
>>> That's a social-engineering problem, not a software-engineering one.
>>> Trying to solve "people in positions of responsibility aren't being
>>> responsible" by technical means has never worked and *will* never
>>> work.
>>
>> It’s easy to think of counterexamples: collision assist in a car, for
>> instance, or automatic braking systems in trains.
>
> Minimal-assistance-in-the-absence-of-direct-supervision is a *very*
> different thing from intelligent-override-of-deliberate-action.

I think some automated braking for goalposts is needed here.

--
https://www.greenend.org.uk/rjk/

Subject: Re: security by kees-cookity [rant]
From: Kaz Kylheku
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 16:30 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 643-408-1753@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 16:30:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20240529092416.92@kylheku.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<20240523182552.895@kylheku.com>
<87pltb2pju.fsf@doppelsaurus.mobileactivedefense.com>
<wwvzfse59dd.fsf@LkoBDZeT.terraraq.uk>
<87h6ekhlte.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com>
<wwv1q5ljbv9.fsf@LkoBDZeT.terraraq.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 18:30:22 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a75549dbea27ab99be83d96fc9705b26";
logging-data="1286973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MjqoOLhtXZ6zPbedzU9pjz0ov0izs9KE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:L1cjPnIydb/+zJ9EVdrFe/j6dSU=
View all headers

On 2024-05-29, Richard Kettlewell <invalid@invalid.invalid> wrote:
> John Ames <commodorejohn@gmail.com> writes:
>> Richard Kettlewell <invalid@invalid.invalid> wrote:
>>> Easy enough to arrange in a shared environment. Find a bit of software
>>> relevant to the attacker’s job (or the job of whoever’s unprivileged
>>> login they’ve compromised) and ask the IT department to install it.
>>
>> That's a social-engineering problem, not a software-engineering one.
>> Trying to solve "people in positions of responsibility aren't being
>> responsible" by technical means has never worked and *will* never work.
>
> It’s easy to think of counterexamples: collision assist in a car, for
> instance, or automatic braking systems in trains.

Reacting to an emergency event in a millisecond isn't a social
engineering problem of someone being irresponsible. It's something
only technology can do.

Accidents happen to the responsible. You're not irresponsible on account
of trusting that the opposite vehicle will not abruptly cross the median
line into your path in the last moment of the approach. Yet, such a
thing happens in the world.

Subject: Re: security by kees-cookity [rant]
From: Rainer Weikusat
Newsgroups: comp.unix.programmer
Date: Wed, 29 May 2024 17:12 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: rweikusat@talktalk.net (Rainer Weikusat)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 18:12:20 +0100
Lines: 19
Message-ID: <878qzs5yq3.fsf@doppelsaurus.mobileactivedefense.com>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<20240528103438.00005f0b@gmail.com>
<87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com>
<v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr>
<0oI5O.7253$gkW.1029@fx40.iad>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 9/krwQmir8MgCzXLXgQMcwHNnaFR+0EL8A48JdzmmeLFTO2v4=
Cancel-Lock: sha1:Gvtf4TvCT2RaXP5POYkbtpE7JLE= sha1:zdXHvG3aIjBIl8VAZWlp1nOqVOk= sha256:mB3aoGw9VX5VX94NDrEwzDdq9Md4yVIpiID2jHr/GFs=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
View all headers

scott@slp53.sl.home (Scott Lurndal) writes:
> Nicolas George <nicolas$george@salle-s.org> writes:
>>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
>> a écrit :
>>> The simple answer being that no process uses /tmp unless it needs to share
>>> data with another via files.
>>
>>So where should they put their temporary files?
>
> $ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}
>
> Note that /tmp and /var/tmp usually have the "Sticky" mode bit
> set which limits the operations that a non-owner can
> perform on a file in that directory.

This solves only half of the problem: mkdir will fail if the given
filesystem name already exists. Some scheme to create unguessable names
and try using them until success would still be needed on top of that.

Subject: Re: security by kees-cookity [rant]
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 17:13 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 17:13:45 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <v37no9$17tpi$1@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com> <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com> <20240528103438.00005f0b@gmail.com> <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com> <v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr>
Injection-Date: Wed, 29 May 2024 19:13:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfb490889791f03fcce85bc5172105c7";
logging-data="1308466"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eG0dNwhWAFsBPfgO//bHb"
Cancel-Lock: sha1:+BE/2DKWfyAi5vFvS0YHVqvxI6c=
View all headers

On 29 May 2024 15:39:08 GMT
Nicolas George <nicolas$george@salle-s.org> wrote:
>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
> a �crit�:
>> The simple answer being that no process uses /tmp unless it needs to share
>> data with another via files.
>
>So where should they put their temporary files?

Create a dot directory in the users home dir and use that. Which is what
a lot of applications have done for years. Obviously if the user has a quota
but the app wants to create gigabyte sized files then another approach is
needed, but for small files that arn't around for long it works fine.

Subject: Re: security by kees-cookity [rant]
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 17:28 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 17:28:23 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <v37ojn$1821q$1@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk>
<20240528075707.00004bcf@gmail.com>
<20240528103438.00005f0b@gmail.com>
<87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com>
<v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr>
<0oI5O.7253$gkW.1029@fx40.iad>
<878qzs5yq3.fsf@doppelsaurus.mobileactivedefense.com>
Injection-Date: Wed, 29 May 2024 19:28:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfb490889791f03fcce85bc5172105c7";
logging-data="1312826"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fmz1N2arATF0+G576d+uH"
Cancel-Lock: sha1:Rv4DvSvI5fF1gzMJAhLYhCNGD68=
View all headers

On Wed, 29 May 2024 18:12:20 +0100
Rainer Weikusat <rweikusat@talktalk.net> wrote:
>scott@slp53.sl.home (Scott Lurndal) writes:
>> Nicolas George <nicolas$george@salle-s.org> writes:
>>>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
>>> a écrit :
>>>> The simple answer being that no process uses /tmp unless it needs to share
>>>> data with another via files.
>>>
>>>So where should they put their temporary files?
>>
>> $ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}
>>
>> Note that /tmp and /var/tmp usually have the "Sticky" mode bit
>> set which limits the operations that a non-owner can
>> perform on a file in that directory.
>
>This solves only half of the problem: mkdir will fail if the given
>filesystem name already exists. Some scheme to create unguessable names
>and try using them until success would still be needed on top of that.

Process id + time and date down to the microsecond in the filename usually
solves that problem. If multi threaded then throw in the thread id too.
Creating unique filenames isn't a problem so long as everyone sticks to the
scheme.

Subject: Re: security by kees-cookity [rant]
From: Scott Lurndal
Newsgroups: comp.unix.programmer
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 29 May 2024 17:32 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!weretis.net!feeder8.news.weretis.net!npeer.as286.net!npeer-ng0.as286.net!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx01.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: security by kees-cookity [rant]
Newsgroups: comp.unix.programmer
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com> <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com> <20240528103438.00005f0b@gmail.com> <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com> <v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr> <0oI5O.7253$gkW.1029@fx40.iad> <878qzs5yq3.fsf@doppelsaurus.mobileactivedefense.com> <v37ojn$1821q$1@dont-email.me>
Lines: 30
Message-ID: <qEJ5O.4655$L7p2.3808@fx01.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 29 May 2024 17:32:06 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 29 May 2024 17:32:06 GMT
X-Received-Bytes: 2266
View all headers

Muttley@dastardlyhq.com writes:
>On Wed, 29 May 2024 18:12:20 +0100
>Rainer Weikusat <rweikusat@talktalk.net> wrote:
>>scott@slp53.sl.home (Scott Lurndal) writes:
>>> Nicolas George <nicolas$george@salle-s.org> writes:
>>>>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
>>>> a écrit :
>>>>> The simple answer being that no process uses /tmp unless it needs to share
>>>>> data with another via files.
>>>>
>>>>So where should they put their temporary files?
>>>
>>> $ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}
>>>
>>> Note that /tmp and /var/tmp usually have the "Sticky" mode bit
>>> set which limits the operations that a non-owner can
>>> perform on a file in that directory.
>>
>>This solves only half of the problem: mkdir will fail if the given
>>filesystem name already exists. Some scheme to create unguessable names
>>and try using them until success would still be needed on top of that.
>
>Process id + time and date down to the microsecond in the filename usually
>solves that problem. If multi threaded then throw in the thread id too.
>Creating unique filenames isn't a problem so long as everyone sticks to the
>scheme.
>

$ man 1 mktemp

Subject: Re: security by kees-cookity [rant]
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 17:43 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 17:43:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <v37pgi$1876q$1@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com> <wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com> <20240528103438.00005f0b@gmail.com> <87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com> <v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr> <0oI5O.7253$gkW.1029@fx40.iad> <878qzs5yq3.fsf@doppelsaurus.mobileactivedefense.com> <v37ojn$1821q$1@dont-email.me> <qEJ5O.4655$L7p2.3808@fx01.iad>
Injection-Date: Wed, 29 May 2024 19:43:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="cfb490889791f03fcce85bc5172105c7";
logging-data="1318106"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/SfrglWNaD05gm08e3KJm"
Cancel-Lock: sha1:Xt8Oj8LW0JN5T7rw6eckLQkDlDg=
View all headers

On Wed, 29 May 2024 17:32:06 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Wed, 29 May 2024 18:12:20 +0100
>>Rainer Weikusat <rweikusat@talktalk.net> wrote:
>>>scott@slp53.sl.home (Scott Lurndal) writes:
>>>> Nicolas George <nicolas$george@salle-s.org> writes:
>>>>>Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
>>>>> a écrit :
>>>>>> The simple answer being that no process uses /tmp unless it needs to
>share
>>>>>> data with another via files.
>>>>>
>>>>>So where should they put their temporary files?
>>>>
>>>> $ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}
>>>>
>>>> Note that /tmp and /var/tmp usually have the "Sticky" mode bit
>>>> set which limits the operations that a non-owner can
>>>> perform on a file in that directory.
>>>
>>>This solves only half of the problem: mkdir will fail if the given
>>>filesystem name already exists. Some scheme to create unguessable names
>>>and try using them until success would still be needed on top of that.
>>
>>Process id + time and date down to the microsecond in the filename usually
>>solves that problem. If multi threaded then throw in the thread id too.
>>Creating unique filenames isn't a problem so long as everyone sticks to the
>>scheme.
>>
>
>$ man 1 mktemp

No thanks, particularly if NFS is involved anywhere.

Subject: Re: security by kees-cookity [rant]
From: James Kuyper
Newsgroups: comp.unix.programmer
Organization: A noiseless patient Spider
Date: Wed, 29 May 2024 18:14 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.unix.programmer
Subject: Re: security by kees-cookity [rant]
Date: Wed, 29 May 2024 14:14:35 -0400
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <v37rbf$18ai5$2@dont-email.me>
References: <87pltc5kdl.fsf@doppelsaurus.mobileactivedefense.com>
<wwvfru3y8dp.fsf@LkoBDZeT.terraraq.uk> <20240528075707.00004bcf@gmail.com>
<20240528103438.00005f0b@gmail.com>
<87v82xpsxr.fsf@doppelsaurus.mobileactivedefense.com>
<v36kd8$11r1b$1@dont-email.me> <66574c1c$0$8220$426a74cc@news.free.fr>
<0oI5O.7253$gkW.1029@fx40.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 May 2024 20:15:11 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a6f789037d97dc2fb064920b8c0acf63";
logging-data="1321541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Zp8lEAInVqEBTwE1NqQ1O08T2OEV4kaQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JCaCyG+LVY63TsPta1v1TqKFQT0=
Content-Language: en-US
In-Reply-To: <0oI5O.7253$gkW.1029@fx40.iad>
View all headers

On 5/29/24 12:06, Scott Lurndal wrote:
> Nicolas George <nicolas$george@salle-s.org> writes:
>> Muttley@dastardlyhq.com, dans le message <v36kd8$11r1b$1@dont-email.me>,
>> a écrit :
>>> The simple answer being that no process uses /tmp unless it needs to
>>> share
>>> data with another via files.
>>
>> So where should they put their temporary files?
>
> $ mkdir ${TMPDIR}/${LOGNAME} && chown 1700 ${TMPDIR}/${LOGNAME}

That doesn't answer the question, it just moves it. With this
suggestion, the original question is equivalent to asking "what should
TMPDIR be set to?"

Pages:12

rocksolid light 0.9.8
clearnet tor