The temporary tablespace is determined by CURRENT_SCHEMA, not by the current/authenticated user. Typically CURRENT_SCHEMA is overridden by stored procedure calls which set it to the owner of the procedure, but as you've discovered, you can also set it manually for ad-hoc SQL.
Tested with both GTTs which are owned non-PLSQL objects, and with temporary LOBs:
Run as MYOWNER:
Test #1:
create global temporary table myowner.gtest (col1 integer) on commit preserve rows;
/
alter session set current_schema=MYUSER1;
/
declare
var_tablespace varchar2(128);
begin
insert into myowner.gtest values (1);
SELECT MAX(tablespace)
INTO var_tablespace
FROM v$sort_usage
WHERE session_addr = (SELECT saddr FROM v$session WHERE sid = SYS_CONTEXT('USERENV','SID'));
dbms_output.put_line(var_tablespace);
end;
Test #2:
alter session set current_schema=MYUSER1;
/
declare
my_lob clob;
var_tablespace varchar2(128);
begin
DBMS_LOB.CREATETEMPORARY (my_lob,false);
SELECT MAX(tablespace)
INTO var_tablespace
FROM v$sort_usage
WHERE session_addr = (SELECT saddr FROM v$session WHERE sid = SYS_CONTEXT('USERENV','SID'));
dbms_output.put_line(var_tablespace);
end;
In both cases, the temporary tablespace reported as that assigned to MYUSER1, not that assigned to MYOWNER (which happens to be different).
It is true that CURRENT_SCHEMA does not change your permissions, but using temporary space in one tablespace or the other isn't a protected privileged action. All users have the right to use temp space, without quota, and no user owns a temporary tablespace, so there's no question of privileges involved. While the DBAs can do basic resource balancing by creating and assigning different temp tablespaces to different users, it
can be overridden and so should not be treated as a guaranteed assignment.
So, if you don't want your user using a particular temporary tablespace, don't set CURRENT_SCHEMA to a schema assigned to that tablespace, nor call any stored procedures owned by such a schema. If you are trying to prevent some other user from doing so, since this is an always-permitted ALTER SESSION setting that doesn't require the ALTER SESSION privilege, you cannot block it. You'd think you could implement a DDL system trigger to intercept it and raise an exception denying it, but DDL triggers do not fire for ALTER SESSION because unlike all other ALTERs this one does not modify the data dictionary.
About the only mechanism I can think of that would prevent the wrong user from filling up the wrong temp tablespace is to have a scheduled monitoring script (e.g. once a minute) examine v$sort_usage, detect the undesired usage, and kill the session or cancel the SQL.
current_schemareally dong that though? I don't have a way to test it at the moment, but the docs say "This setting changes the current schema, but it does not change the session user or the current user, nor does it give the session user any additional system or object privileges for the session." So I'm surprised.