Bug Description
The text-salting defense feature (originally implemented for #896, which is closed) is broken in two independent ways:
backend/routes/saltingRoutes.js is never require'd or app.use()'d in backend/server.js, so any endpoint it defines doesn't exist on the running server at all.
- Even if the router were mounted, it targets the wrong file: it builds its script path as
text_salting_detector.js, but the actual detector shipped in the repo is backend/text_salting_detector.py (a Python file). spawn('python', [SALTING_SCRIPT, ...]) would try to run a .js file that doesn't exist, so every call would fail with ENOENT regardless.
Wrong script extension: backend/routes/saltingRoutes.js L8
Unmounted router: not referenced anywhere in backend/server.js — compare with sibling routers adversarialRoutes, evoMailRoutes, poisoningRoutes, which are all required (L31–L33) and mounted (L287–L289)
Actual detector file: backend/text_salting_detector.py
Steps to Reproduce
- Confirm the router is never mounted:
grep -n "saltingRoutes" backend/server.js
# (no output — the file is never required or app.use()'d)
- Start the server and hit any plausible salting endpoint:
curl -i http://localhost:5000/api/salting/detect -X POST -d '{"html":"<p>test</p>"}'
- Separately confirm the script path mismatch:
ls backend/text_salting_detector.js # No such file or directory
ls backend/text_salting_detector.py # <- this is the real file
Expected Behavior
POST /api/salting/detect should run text_salting_detector.py against the supplied HTML and return a salting-attack analysis; GET /api/salting/status should return detector status.
Actual Behavior
POST /api/salting/detect (or any salting route) returns 404 Not Found because the router is never registered with the Express app. If manually mounted for testing, it then fails with spawn python ENOENT because it targets text_salting_detector.js, which doesn't exist.
Screenshots
No response
Additional Information
No response
Bug Description
The text-salting defense feature (originally implemented for #896, which is closed) is broken in two independent ways:
backend/routes/saltingRoutes.jsis neverrequire'd orapp.use()'d inbackend/server.js, so any endpoint it defines doesn't exist on the running server at all.text_salting_detector.js, but the actual detector shipped in the repo isbackend/text_salting_detector.py(a Python file).spawn('python', [SALTING_SCRIPT, ...])would try to run a.jsfile that doesn't exist, so every call would fail withENOENTregardless.Wrong script extension:
backend/routes/saltingRoutes.jsL8Unmounted router: not referenced anywhere in
backend/server.js— compare with sibling routersadversarialRoutes,evoMailRoutes,poisoningRoutes, which are all required (L31–L33) and mounted (L287–L289)Actual detector file:
backend/text_salting_detector.pySteps to Reproduce
curl -i http://localhost:5000/api/salting/detect -X POST -d '{"html":"<p>test</p>"}'Expected Behavior
POST /api/salting/detectshould runtext_salting_detector.pyagainst the supplied HTML and return a salting-attack analysis;GET /api/salting/statusshould return detector status.Actual Behavior
POST /api/salting/detect(or any salting route) returns404 Not Foundbecause the router is never registered with the Express app. If manually mounted for testing, it then fails withspawn python ENOENTbecause it targetstext_salting_detector.js, which doesn't exist.Screenshots
No response
Additional Information
No response