You will have both hydraulic system plumbing lines, the metal pipes, and wiring harnesses running along the rear spar, serving hydraulic actuators and electrical components like sensors and servos, etc.
The hydraulic plumbing is already hermetically sealed, being hydraulic plumbing holding 3000 psi (21 MPa), so being exposed is no big deal. The wiring harnesses running along the spar will be encased in waterproof sheathing, and the electrical connectors (cannon plug type generally) will be ones designed for exterior use with hermetically sealed back shells integrated into the harness sheathing.
It's a very demanding environment because the electrical components have to maintain their integrity while subjected to temperature cycles from surface ambient down to -60°C at altitude, plus pressure cycles. Any air leaks that allow the sheath or connector to breathe will pull water in as air is drawn in during descents as the pressure in cavities equalizes. Components in locations like that have to be designed to fully breathe, and withstand direct exposure to moisture, or else be hermetically sealed.
Water getting into the harness wire looms will wick up inside and corrode the internal shielding. Water getting into the electrical connectors will cause crosstalk between electrical circuits as moisture provides leak paths between pins, and you will get related system faults when voltages appear at pins that shouldn't. The weak points for water ingress are usually the boots that cover the back shells of electrical connectors, or the connector interface where it plugs into something.
The other items you will normally see are control cable runs for non-FBW airplanes, and obviously, flap system drive lines, which all have to be designed to withstand the exposed environment (actually more or less enclosed when at altitude, the exposure is only when flaps are down or spoilers are up, but they are still exposed to the pressure/temperature cycles).
You would think that you would use stainless steel control cables for these runs, but, at least in RJ world, only galvanized steel cables are used because stainless has less strength and doesn't like to rub against itself (the cable strands break down over time where the cable goes around corners). So one thing you have to inspect for during heavy checks is cable corrosion (rust) and pully bearings breaking down and seizing (especially horizontally mounted pulleys, as the grease slowly leaks out of the bearing).
The wing box forward of the spar is full of fuel, and to run that stuff through the tanks will require conduit pipes and result in poor access, so along the rear spar in the open is the easiest place to route all that stuff for ease of maintenance. But overall, keeping the moisture out of the electrical harnesses and connectors is probably the biggest struggle.