We analyze the general structure of soft scalar masses emerging in superstring models involving anomalous U(1) symmetries, with the aim of characterizing more systematically the circumstances under which they can happen to be flavor universal. We consider both heterotic orbifold and intersecting brane models, possibly with several anomalous and non-anomalous spontaneously broken U(1) symmetries. The hidden sector is assumed to consist of the universal dilaton, Kahler class and complex structure moduli, which are supposed to break supersymmetry, and a minimal set of Higgs fields which compensate the Fayet-Iliopoulos terms. We leave the superpotential that is supposed to stabilize the hidden sector fields unspecified, but we carefully take into account the relations implied by gauge invariance and the constraints required for the existence of a metastable vacuum with vanishing cosmological constant. The results are parametrized in terms of a constrained Goldstino direction, suitably defined effective modular weights, and the U(1) charges and shifts. We show that the effect induced by vector multiplets strongly depends on the functional form of the Kahler potential for the Higgs fields. We find in particular that whenever these are charged matter fields, like in heterotic models, the effect is non-trivial, whereas when they are shifting moduli fields, like in certain intersecting brane models, the effect may vanish.