Skip to content
M&L AI

openlens-fw

Hardened, open-source replacement firmware for the Anpviz IPC-D240W-S IP camera.

beta

The Anpviz IPC-D240W-S is an inexpensive PoE camera. Its stock firmware had 24 published vulnerabilities, disclosed through CISA and CERT/CC in 2026, and the vendor stopped answering. openlens-fw replaces that firmware’s whole userland with a small one written for this camera: video, RTSP, ONVIF, a web UI over HTTPS, day/night with IR, and signed updates, with nothing left of the stock software but the kernel and the drivers it needs.

You build the image yourself, sign it with your own key, and install it on a camera you own. It records to Synology Surveillance Station every day on the developer’s cameras.

Read the docs View on GitHub

What it does

Video for your NVR

H.264 or H.265 main stream up to 2560x1440 and a sub-stream up to 1280x720, 30 fps. RTSP on 554, RTSPS on 322, ONVIF Profile S with motion events, and JPEG snapshots.

No shared credentials

An image holds no account, password or key, and the build fails if it finds one. You claim each camera after the install, in a 30-minute window after power-on, and get a one-time recovery code.

Updates only you can sign

A camera installs only packages signed by keys in its own image, and you make those keys. An older version needs a package you signed as a downgrade on purpose. No vendor key, and no way for anyone else to push firmware to your cameras.

HTTPS with its own CA

Each camera makes its own certificate authority, limited to your camera subnet, and issues its own certificate. You trust it once per computer. Its keys never leave the camera.

Nothing on the network runs as root

RTSP, NTP, TLS and the web worker each run as their own user. Only a small monitor holds passwords and does privileged work, behind grants.

SSH done properly

Dropbear with keys only and post-quantum key exchange. No telnet, and no root login on the serial console.

How it works

The camera keeps its stock bootloader and kernel. openlens-fw replaces only the rootfs partition with its own programs, which drive the SigmaStar video hardware through raw ioctls instead of the vendor’s media server. Settings, accounts and keys live on the data partition and survive updates. How it works has the parts and the security design.

What it leaves to you

  • Network isolation. Surveillance Station can’t use TLS with a generic ONVIF camera, so it talks plain RTSP and ONVIF (Digest logins, unencrypted video). Put the cameras on their own VLAN.
  • Physical protection. The stock bootloader doesn’t check signatures: anyone with a serial console or a flash clip can run any firmware.
  • Time. NTP isn’t authenticated; use a time server inside the camera network.

The security model lists each limit and what to do about it.

openlens-fw is not affiliated with or endorsed by Anpviz, Anjoy or SigmaStar. “Anpviz” names the hardware it runs on.