Skip to content

Conversation

@Tokisaki-Galaxy
Copy link
Contributor

@Tokisaki-Galaxy Tokisaki-Galaxy commented Jan 29, 2026

image image

the app must changed LuCI core file because:

  • No hook point exists between password verification and session creation
  • External packages cannot inject authentication logic
  • No plugin discovery mechanism in the original code

Security Measures

Constant-time string comparison to prevent timing attacks
Username sanitization to prevent command injection
Array-based popen to prevent shell injection
OTP format validation (exactly 6 digits)
Session destroyed if 2FA verification fails
Uses authenticated session username to prevent bypass attacks

origin repo https://github.com/Tokisaki-Galaxy/luci-app-2fa

@github-actions

This comment has been minimized.

@Neustradamus
Copy link

@Tokisaki-Galaxy: Nice, good job!

Do not forget to solve:

🔶 Author name (Tokisaki-Galaxy) seems to be a nickname or an alias
🔶 Committer name (Tokisaki-Galaxy) seems to be a nickname or an alias

@stangri
Copy link
Member

stangri commented Jan 29, 2026

Looks very polished @Tokisaki-Galaxy!

Does this use TOTP? If the OpenWrt device doesn't have RTC and is offline or generally doesn't have correct time, does SSH become the only option to login?

Is there a README/instructions (ideally a hint on failed attempt) on how to disable 2FA from SSH/CLI for people who may be locked out of WebUI and can't read code ahead of time?

@Tokisaki-Galaxy
Copy link
Contributor Author

Tokisaki-Galaxy commented Jan 30, 2026

At present, we are dealing with the interface logic of interaction with luci core #8281 and the logic of app should be put aside first.
The draft of pr is submitted now to collect opinions and facilitate understanding of pr 8281.

At present, my rough goal is
Use TOTP/HOTP (but since most 2fa validators are designed for TOTP, I plan to do it after completing all the functions of TOTP).
Modify the process to verify whether the user's 2FA is saved when starting 2FA.

  • Full-Support TOTP
  • User-defined 2FA frequency and rules
  • IP whitelist
  • Time-based access restriction
    ...
  • Support HOTP

When abnormal time is detected under TOTP, 2FA will be automatically disabled, so as to minimize the user's inability to log in and need to be manually disabled through ssh.

Tokisaki-Galaxy

This comment was marked as outdated.

@Tokisaki-Galaxy Tokisaki-Galaxy changed the title [WIP] luci-app-2fa: init checkin luci-app-2fa: init checkin Feb 2, 2026
@Tokisaki-Galaxy Tokisaki-Galaxy force-pushed the tokisaki-luci-app-otp branch 2 times, most recently from d55e8c5 to 0e97b5b Compare February 2, 2026 04:46
@github-actions

This comment has been minimized.

Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: tokisaki galaxy <moebest@outlook.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants