1
 
                                                                   EXHIBIT 23(G)
 
                      CONSENT OF PAINEWEBBER INCORPORATED
 
Walden Bancorp, Inc.
125 Nagog Park
Acton, Massachusetts 01720
 
Ladies and Gentlemen:
 
     We hereby consent to the use of our written opinion letter dated as of the
date of this Joint Proxy Statement - Prospectus to the Board of Directors of
Walden Bancorp, Inc. included as Appendix E to the Joint Proxy Statement -
Prospectus which forms part of the Registration Statement on Form S-4 relating
to the proposed merger of a wholly-owned subsidiary of UST Corp. with and into
Walden Bancorp, Inc. and to the references to such opinion, to our August 29,
1996 oral and written opinion and to this firm in such Joint Proxy Statement -
Prospectus. In giving such consent, we do not admit that we come within the
category of persons whose consent is required under Section 7 of the Securities
Act of 1933, as amended, or the rules and regulations of the Securities and
Exchange Commission thereunder, nor do we admit that we are experts with respect
to any part of such Registration Statement within the meaning of the term
"experts" as used in the Securities Act of 1933, as amended, or the rules and
regulations of the Securities and Exchange Commission thereunder.
 
                                            Very truly yours,
 
                                            PAINEWEBBER INCORPORATED
 
                                            By: /s/  JAMES W. KILMAN, JR.
 
                                              ----------------------------------
                                              Name: James W. Kilman, Jr.
                                              Title:   Managing Director
 
November 5, 1996