Integrate feedback from security audit #36

Closed
opened 2025-09-18 09:30:36 +02:00 by utopiah · 15 comments
Owner
No description provided.
utopiah added the Process audits from NLNet network label 2025-09-18 09:30:36 +02:00
utopiah added this to the NGI0 Commons Fund 2025-04 milestone 2025-09-18 14:00:10 +02:00
Author
Owner

Similarly to #37 this has to be seen within the context of prototyping. Consequently even though users are invited to self-host their instance, and ideally federate, they also understand that this is experimental. Typical good practices are suggested proper passwords, data backup, isolation through e.g container without being the main initial focus.

Similarly to #37 this has to be seen within the context of prototyping. Consequently even though users are invited to self-host their instance, and ideally federate, they also understand that this is experimental. Typical good practices are suggested proper passwords, data backup, isolation through e.g container without being the main initial focus.
Author
Owner

Authentication via a token as in https://git.benetou.fr/utopiah/offline-octopus/src/branch/master/index.js would probably not pass in another context but here it might be acceptable with warnings.

Authentication via a token as in https://git.benetou.fr/utopiah/offline-octopus/src/branch/master/index.js would probably not pass in another context but here it might be acceptable with warnings.
Author
Owner

Currently the API is not restricted, even write endpoints.

Currently the API is not restricted, even write endpoints.
Author
Owner

Sanitized some path input but should be entirely constrained instead.

Sanitized some path input but should be entirely constrained instead.
Author
Owner

Note that with the current system in place to generate nickname, there is no (to verify) no PII, namely no birthdate, no name, no contact information stored.

Note that with the current system in place to generate nickname, there is no (to verify) no PII, namely no birthdate, no name, no contact information stored.
utopiah added the Review pending label 2026-04-13 14:46:59 +02:00
utopiah removed the Review pending label 2026-04-16 14:11:37 +02:00
Author
Owner
Consider https://cooldowns.dev
Author
Owner

Clarify surface on frontend and backend (see #55).

Backend is expected to run in a container and behind a reverse proxy.

Clarify surface on frontend and backend (see #55). Backend is expected to run in a container and behind a reverse proxy.
Author
Owner
Consider https://developer.mozilla.org/en-US/docs/Web/API/Trusted_Types_API
Author
Owner

Note that eval() is used few times in core places.

  • justified, namely it's about helping anybody to program with the lowest barrier to entry (no build step, no tooling, all in the browser), so via jxr commands
  • also used for #18 which is powerful, giving a lot of flexibility, but risky too.
Note that `eval()` is used few times in core places. - justified, namely it's about helping anybody to program with the lowest barrier to entry (no build step, no tooling, all in the browser), so via `jxr` commands - also used for #18 which is powerful, giving a lot of flexibility, but risky too.
Author
Owner

See also https://voicesofvr.com/1719-rip-rec-room-reflections-memories-with-shawn-whiting/ on cross platforn UGC and "hacker" problems. Seems to revolve around competition and in-game economy.

Crucial aspect of distinguishing genuine skill

See also https://voicesofvr.com/1719-rip-rec-room-reflections-memories-with-shawn-whiting/ on cross platforn UGC and "hacker" problems. Seems to revolve around competition and in-game economy. Crucial aspect of distinguishing genuine skill
Author
Owner

Eval token for NAF,

  • disabled by default,
  • enabled via back end one or
  • user defined.
Eval token for NAF, - disabled by default, - enabled via back end one or - user defined.
Author
Owner
See https://git.radicallyopensecurity.com/ngi/ngics-federating-pedagogical-immersive-experiences (authentication required)
Author
Owner
Consider https://docs.docker.com/reference/dockerfile/#add---checksum and if possible npm equivalent for https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/package.json#L6
Author
Owner

See work done in 87efccc4c0

See work done in https://git.benetou.fr/utopiah/biggu_s_gate/commit/87efccc4c0d48bec4a27536a7ed934409ee2da7a
utopiah added the Review pending label 2026-07-01 10:02:29 +02:00
Author
Owner

Work done in 87efccc4c0 thanks to audit from radicallyopensecurity (non-public link for now).

Note that not all issues are solved but the biggest ones are. The most impactful changes are :

  • introduction of a WORKSHOP environment variable to distinguish between WAN and LAN. A lot of experiments can be run safely on LAN where the typical setup is either a single XR headset (hosting its own instance thanks to e.g Termux, entirely offline and standalone, as demonstrated for the first time or more traditionally with an affordable server, e.g SBC like RPi Zero.
  • this new variable usage is facilitated with npm run workshop new command
  • checksum on assets was added and could be expanded conveniently if more resources are made available, e.g assets of remixes
  • rate limiting and security headers have been added and enabled by default. They are optionally disabled via the explicit new WORKSHOP mode.
  • whitelisting of assets has been added for Icosa in particular. It is not sufficient but already should limit significantly the risk there.
  • evaluation of code in a networked environment is very powerful for tutoring. Unfortunately it is, as highlighted by the report, very risky. Even though it is limited because typically XR HMDs do not have PIIs it is still problematic. Consequently it is now disabled by default on WAN. Networking is also by default in a per-user room, namely it is still possible but one must explicitly share a URL to "their" room which contain by default their nickname.
  • networking logging has been lowered in order to make output more readible to instance administrators, in particular to highlight new information related to security, e.g. workshop mode enabling

Overall it was a very interesting process and definitely valuable. The biggest fear was that the project would be either basically unusable, that there would be only problems but no practical suggestions (e.g. only patterns but not libraries with reasonable default settings). The report once finalized by RadicallyOpenSecurity will be made public with their approval. The purpose here is to show workshop participants that a professional programmer always has a lot to learn. It is also done with the hope that institutions, e.g. libraries, toy libraries, schools, etc will see that the work is done with contributions from a lot of different professionals and even if though the medium, XR, is new, good security practices are still in place.

That being said more must still be done. Some issues remain open despite the bulk of the work now done. It would be positive to do another audit in the future to see if the patterns (reasonable defaults, input sanitation, environment distinction) are followed while still trying genuinely novel ways to learn.

Finally note that a discussion on using the project itself to teach about security could be done. Indeed the project aims at helping kids in particular but in truth anyone to remix content. This is done in XR but without hiding that it is done with code. Consequently making more "tangible" not just code but also how it must be correctly handle, and when, would be very interesting. An idea was to showcase input validation visualization, e.g. a line going from text as code to evaluation heading to a (virtual) CPU (see #149 on-going experiments) and if there is user input a cylinder around, as a kind of "shield" to insure it is properly verified to make sure the CPU (or rather the environment its runs in) behaves as expected. Users could then pick different cylinders with predefined validation methods, e.g. regex on email format or color ranges. I think it might learners, including myself, understand pragmatically. This is coherent with past work on #35 namely where the project can help to follow good practice by surfacing and manipulating its own artefacts.

Work done in https://git.benetou.fr/utopiah/biggu_s_gate/commit/87efccc4c0d48bec4a27536a7ed934409ee2da7a thanks to audit from radicallyopensecurity ([non-public link for now](https://git.radicallyopensecurity.com/ngi/ngics-federating-pedagogical-immersive-experiences/)). Note that not all issues are solved but the biggest ones are. The most impactful changes are : - introduction of a `WORKSHOP` environment variable to distinguish between WAN and LAN. A lot of experiments can be run safely on LAN where the typical setup is either a single XR headset (hosting its own instance thanks to e.g Termux, entirely offline and standalone, as [demonstrated for the first time](https://video.benetou.fr/w/hb2PWdsfZqJAkuJHPwGW13) or more traditionally with an affordable server, e.g SBC like RPi Zero. - this new variable usage is facilitated with [npm run workshop](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/package.json#L9) new command - [checksum on assets](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/package.json#L6) was added and could be expanded conveniently if more resources are made available, e.g assets of remixes - rate limiting and security headers have been added and enabled by default. They are [optionally disabled via the explicit new WORKSHOP mode](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/server/biggu_backend_express_naf_extension.js#L36-L45). - [whitelisting of assets](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/server/biggu_backend_express_naf_extension.js#L207-L218) has been added for Icosa in particular. It is not sufficient but already should limit significantly the risk there. - evaluation of code in a networked environment is very powerful for tutoring. Unfortunately it is, as highlighted by the report, very risky. Even though it is limited because typically XR HMDs do not have PIIs it is still problematic. Consequently it is [now disabled by default on WAN](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/pages/remixed_room.html#L114-L120). Networking is also by [default in a per-user room](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/pages/remixed_room.html#L269), namely it is still possible but one must explicitly share a URL to "their" room which contain by default their nickname. - [networking logging has been lowered](https://git.benetou.fr/utopiah/biggu_s_gate/src/branch/main/server/easyrtc-server.js#L88) in order to make output more readible to instance administrators, in particular to highlight new information related to security, e.g. workshop mode enabling Overall it was a very interesting process and definitely valuable. The biggest fear was that the project would be either basically unusable, that there would be only problems but no practical suggestions (e.g. only patterns but not libraries with reasonable default settings). The report once finalized by RadicallyOpenSecurity will be made public with their approval. The purpose here is to show workshop participants that a professional programmer always has a lot to learn. It is also done with the hope that institutions, e.g. libraries, toy libraries, schools, etc will see that the work is done with contributions from a lot of different professionals and even if though the medium, XR, is new, good security practices are still in place. That being said more must still be done. Some issues remain open despite the bulk of the work now done. It would be positive to do another audit in the future to see if the patterns (reasonable defaults, input sanitation, environment distinction) are followed while still trying genuinely novel ways to learn. Finally note that a discussion on using the project itself to teach about security could be done. Indeed the project aims at helping kids in particular but in truth anyone to remix content. This is done in XR but without hiding that it is done with code. Consequently making more "tangible" not just code but also how it must be correctly handle, and when, would be very interesting. An idea was to showcase input validation visualization, e.g. a line going from text as code to evaluation heading to a (virtual) CPU (see https://git.benetou.fr/utopiah/biggu_s_gate/issues/149 on-going experiments) and if there is user input a cylinder around, as a kind of "shield" to insure it is properly verified to make sure the CPU (or rather the environment its runs in) behaves as expected. Users could then pick different cylinders with predefined validation methods, e.g. regex on email format or color ranges. I think it might learners, including myself, understand pragmatically. This is coherent with past work on https://git.benetou.fr/utopiah/biggu_s_gate/issues/35 namely where the project can help to follow good practice by surfacing and manipulating its own artefacts.
utopiah removed the Review pending label 2026-08-05 18:56:07 +02:00
Sign in to join this conversation.