CVE 2026-67281 mikrotik webfig/jsproxy Unauthenticated File read (Jsproxy safe test without exploitation part) #207585
Unanswered
sohel160
asked this question in
Programming Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
π·οΈ Discussion Type
Bug
Body
cat jsproxy_safe_poc.py
#!/usr/bin/env python3
"""
CVE-2026-67281 / RouterOS /jsproxy
Safe protocol-level effectiveness PoC
This reproducer intentionally does NOT implement:
- heap grooming
- heap spraying
- traversal
- arbitrary file reads
- credential extraction
- exploit triggering
It verifies the real WebFig /jsproxy channel:
Usage:
Designed for an authorized RouterOS lab/test system.
"""
import argparse
import hashlib
import http.client
import socket
import ssl
import struct
import sys
import time
from urllib.parse import urlparse
============================================================
Constants
============================================================
DEFAULT_PORT = 80
JS_PROXY = "/jsproxy"
MAGIC_SEND = (
b"On the client side, this is the send key; "
b"on the server side, it is the receive key."
)
MAGIC_RECV = (
b"On the client side, this is the receive key; "
b"on the server side, it is the send key."
)
P = 2**255 - 19
A24 = 121665
============================================================
Formatting helpers
============================================================
def hx(data):
return data.hex()
def hexdump(data, width=16):
if not data:
return "(empty)"
============================================================
X25519
This follows the standard Curve25519/X25519 byte representation.
The RouterOS WebFig JavaScript converts between its internal
representation and the byte representation before/after the
curve operation.
============================================================
def x25519(priv, u):
if len(priv) != 32:
raise ValueError("private scalar must be 32 bytes")
def generate_keypair():
import os
============================================================
RC4
RouterOS WebFig master.js:
KSA
i = 0
j = 0
generate() 768 times
This is important: the WebFig implementation uses RC4-drop-768.
============================================================
class RouterOSRC4:
============================================================
RouterOS WebFig key derivation
============================================================
def make_key(master_key, is_send):
============================================================
HTTP /jsproxy transport
============================================================
class JSProxyHTTP:
============================================================
Session
============================================================
class RouterOSSession:
============================================================
Safe M2 payload
============================================================
def build_empty_m2():
============================================================
Local framing self-test
============================================================
def local_frame_test():
============================================================
Main safe probe
============================================================
def run_probe(host, port, ssl_enabled, timeout):
============================================================
Argument parsing
============================================================
def parse_target(value, port_override=None, tls_override=False):
def main():
if name == "main":
sys.exit(main())
Guidelines
All reactions