A composition for forming a film for semiconductor devices, comprising: from 0.001% by mass to 20% by mass with respect to the total composition of a compound including a Si-O bond and a cationic functional group containing at least one of a primary nitrogen atom or a secondary nitrogen atom; a crosslinking agent which includes three or more -C(=O)OX groups (X is a hydrogen atom or an alkyl group having from 1 to 6 carbon atoms) in a molecule, wherein from one to six of the three or more -C(=O)OX groups are -C(=O)OH groups, and which has a weight average molecular weight of from 200 to 600 in an amount such that the ratio (COOH/N) of the number of carboxy groups in the crosslinking agent to the total number of nitrogen atoms in the compound is from 0.1 to 3.0; from 1.0% by mass to 99.99896% by mass with respect to the total composition of a polar solvent, and preferably comprising at least one amine compound selected from the group consisting of an aliphatic amine having a weight average molecular weight, as determined by a gel permeation chromatography method, of from 10,000 to 400,000 and an amine compound having a ring structure in the molecule and having a weight average molecular weight of from 90 to 600, wherein compound is selected from a siloxane diamine, a silane coupling agent having an amino group, and a siloxane polymer having an amino group, crosslinking agent is selected from an alicyclic carboxylic acid comprising an alicyclic structure having from 3 to 8 carbon atoms, a benzene carboxylic acid, a naphthalene carboxylic acid, a diphthalic acid, or a fluorinated aromatic ring carboxylic acid, an alicyclic carboxylic acid ester, a benzene carboxylic acid ester, a naphthalene carboxylic acid ester, a diphthalic acid ester, and a fluorinated aromatic ring carboxylic acid ester, solvent is a solvent having a relative dielectric constant, determined at a frequency of 100 kHz in an atmosphere of 25°C and 30% relative humidity using a mercury probe device, of 5 or more at room temperature, in the case of comprising the at least one amine compound, the crosslinking agent is comprised in an amount such that the ratio (COOH/N) of the number of carboxy groups in the crosslinking agent to the total number of the nitrogen atoms contained in the at least one amine compound and the nitrogen atoms contained in the compound is from 0.1 to 3.0, and in the crosslinking agent, in the three or more -C(=O)OX groups, at least one X is an alkyl group having from 1 to 6 carbon atoms. from 0.001% by mass to 20% by mass with respect to the total composition of a compound including a Si-O bond and a cationic functional group containing at least one of a primary nitrogen atom or a secondary nitrogen atom; a crosslinking agent which includes three or more -C(=O)OX groups (X is a hydrogen atom or an alkyl group having from 1 to 6 carbon atoms) in a molecule, wherein from one to six of the three or more -C(=O)OX groups are -C(=O)OH groups, and which has a weight average molecular weight of from 200 to 600 in an amount such that the ratio (COOH/N) of the number of carboxy groups in the crosslinking agent to the total number of nitrogen atoms in the compound is from 0.1 to 3.0; from 1.0% by mass to 99.99896% by mass with respect to the total composition of a polar solvent, and preferably comprising at least one amine compound selected from the group consisting of an aliphatic amine having a weight average molecular weight, as determined by a gel permeation chromatography method, of from 10,000 to 400,000 and an amine compound having a ring structure in the molecule and having a weight average molecular weight of from 90 to 600, wherein compound is selected from a siloxane diamine, a silane coupling agent having an amino group, and a siloxane polymer having an amino group, crosslinking agent is selected from an alicyclic carboxylic acid comprising an alicyclic structure having from 3 to 8 carbon atoms, a benzene carboxylic acid, a naphthalene carboxylic acid, a diphthalic acid, or a fluorinated aromatic ring carboxylic acid, an alicyclic carboxylic acid ester, a benzene carboxylic acid ester, a naphthalene carboxylic acid ester, a diphthalic acid ester, and a fluorinated aromatic ring carboxylic acid ester, solvent is a solvent having a relative dielectric constant, determined at a frequency of 100 kHz in an atmosphere of 25°C and 30% relative humidity using a mercury probe device, of 5 or more at room temperature, in the case of comprising the at least one amine compound, the crosslinking agent is comprised in an amount such that the ratio (COOH/N) of the number of carboxy groups in the crosslinking agent to the total number of the nitrogen atoms contained in the at least one amine compound and the nitrogen atoms contained in the compound is from 0.1 to 3.0, and in the crosslinking agent, in the three or more -C(=O)OX groups, at least one X is an alkyl group having from 1 to 6 carbon atoms.