What do you mean by "only traveling through JFK airport."
If you mean that you are checking it at JFK, you will may be arrested. That's how they operate there.
If you mean that you are checking in at an airport in PA and changing planes at JFK, then you should be fine as long as you don't run into a situation where your connection is cancelled and you have to collect your bags for the night and recheck in. People have been arrested at NY/NJ airports for that exact same scenario.
"Special advisory for New York & New Jersey airports: Despite federal law that protects travelers, authorities at JFK, La Guardia, Newark, and Albany airports have been known to enforce state and local firearm laws against airline travelers who are passing through their jurisdictions.
In some cases, even persons traveling in full compliance with federal law have been arrested or threatened with arrest. FOPA's protections have been substantially narrowed by court decisions in certain parts of the country, particularly in the Northeast. Persons traveling through New York and New Jersey airports may want to consider shipping their firearms to their final destinations rather than bringing them through airports in these jurisdictions."
"NEW YORK—Use extreme caution when traveling through New York with firearms. New York state’s general approach is to make the possession of handguns and so-called “assault weapons” and “large capacity ammunition feeding devices” illegal and then provide exceptions that the accused may raise as “affirmative defenses” to prosecution in some cases. NY Penal Code s. 265.20(12), (13) & (16).
A number of localities, including Albany, Buffalo, New York City, Rochester, Suffolk County, and Yonkers, impose their own requirements on the possession, registration, and transport of firearms. Possession of a handgun within New York City requires a New York City handgun license or a special permit from the city police commissioner validating a state license within the city. Even New York state licenses are generally not valid within New York City unless a specific exemption applies, such as when the New York City police commissioner has issued a special permit to the licensee or “the firearms covered by such license are being transported by the licensee in a locked container and the trip through the city of New York is continuous and uninterrupted.” Possession of a shotgun or rifle within New York City requires a permit, which is available to non-residents, and a certificate of registration. "